tencentcloud-sdk-nodejs-essbasic 4.1.302 → 4.1.303

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -135,8 +135,8 @@ export class Client extends TencentCloudCommon.AbstractClient {
135
135
  async CreateBatchInitOrganizationUrl(req, cb) {
136
136
  return this.request("CreateBatchInitOrganizationUrl", req, cb);
137
137
  }
138
- async ChannelDescribeAccountBillDetail(req, cb) {
139
- return this.request("ChannelDescribeAccountBillDetail", req, cb);
138
+ async CreateRequestWithEncryption(req, cb) {
139
+ return this.request("CreateRequestWithEncryption", req, cb);
140
140
  }
141
141
  async ChannelDescribeFlowComponents(req, cb) {
142
142
  return this.request("ChannelDescribeFlowComponents", req, cb);
@@ -225,6 +225,9 @@ export class Client extends TencentCloudCommon.AbstractClient {
225
225
  async DeleteOrganizationAuthorizations(req, cb) {
226
226
  return this.request("DeleteOrganizationAuthorizations", req, cb);
227
227
  }
228
+ async ChannelDescribeAccountBillDetail(req, cb) {
229
+ return this.request("ChannelDescribeAccountBillDetail", req, cb);
230
+ }
228
231
  async ModifyFlowDeadline(req, cb) {
229
232
  return this.request("ModifyFlowDeadline", req, cb);
230
233
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tencentcloud-sdk-nodejs-essbasic",
3
- "version": "4.1.302",
3
+ "version": "4.1.303",
4
4
  "description": "腾讯云 API NODEJS SDK",
5
5
  "main": "./tencentcloud/index.js",
6
6
  "module": "./es/index.js",
@@ -1,5 +1,5 @@
1
1
  import * as TencentCloudCommon from "tencentcloud-sdk-nodejs-common";
2
- import { SyncProxyOrganizationResponse, ChannelCreateConvertTaskApiResponse, CreateBatchAdminChangeInvitationsResponse, ChannelCreateFlowRemindsResponse, DescribeUserFlowTypeResponse, ChannelDeleteSealPoliciesRequest, ChannelBatchCancelFlowsResponse, ChannelDescribeSignFaceVideoRequest, ChannelDisableUserAutoSignResponse, DescribeExtendedServiceAuthDetailResponse, CreateLegalSealQrCodeResponse, DescribeCancelFlowsTaskResponse, CreateEmployeeQualificationSealQrCodeResponse, ChannelCreateFlowGroupByTemplatesResponse, ChannelCreateFlowSignReviewRequest, CreateFlowForwardsRequest, DescribeFlowDetailInfoRequest, ChannelCancelFlowResponse, ModifyExtendedServiceRequest, DescribeResourceUrlsByFlowsRequest, CreateFileConvertTaskRequest, CreateChannelOrganizationInfoChangeUrlResponse, ChannelCreateFlowSignUrlResponse, DescribeFileConvertTaskResponse, ChannelCreateBatchSignUrlResponse, CreateBatchAdminChangeInvitationsUrlRequest, ChannelCreatePrepareFlowResponse, CreateBatchInitOrganizationUrlResponse, OperateChannelTemplateResponse, ChannelCreateDynamicFlowApproverResponse, ChannelCreateRoleRequest, CreateOrganizationAuthFileResponse, CreateConsoleLoginUrlResponse, ChannelDeleteRoleUsersRequest, ChannelCreateUserRolesResponse, ChannelCreatePrepareFlowRequest, ChannelCreateFlowSignUrlRequest, ChannelCreateSealPolicyResponse, OperateTemplateRequest, ChannelDescribeSignFaceVideoResponse, ChannelCancelUserAutoSignEnableUrlResponse, ChannelCreateWebThemeConfigRequest, CancelOrganizationFlowsResponse, CreateFlowGroupSignReviewResponse, ChannelCreateConvertTaskApiRequest, ChannelCreateFlowByFilesRequest, UploadFilesResponse, ChannelCreatePreparedPersonalEsignResponse, DescribeResourceUrlsByFlowsResponse, ChannelCreateFlowGroupByFilesRequest, DescribeFileConvertTaskRequest, ChannelCreateOrganizationModifyQrCodeRequest, CreateChannelSubOrganizationActiveRequest, ChannelRenewAutoSignLicenseResponse, ModifyOrganizationBusinessInfoResponse, ChannelDescribeRolesRequest, DescribeBatchOrganizationRegistrationUrlsRequest, PrepareFlowsResponse, ChannelCreateOrganizationBatchSignUrlRequest, GetDownloadFlowUrlResponse, DescribeTemplatesResponse, CreateBatchOrganizationRegistrationTasksResponse, ChannelVerifyPdfRequest, CreateChannelFlowEvidenceReportRequest, ChannelCancelUserAutoSignEnableUrlRequest, DeleteOrganizationAuthorizationsResponse, ChannelCreatePrepareFlowGroupRequest, DescribeExtendedServiceAuthDetailRequest, CreateOrganizationAuthFileRequest, ChannelVerifyPdfResponse, ArchiveDynamicFlowResponse, CreateConsoleLoginUrlRequest, CreateLegalSealQrCodeRequest, CreateCloseOrganizationUrlRequest, CreatePersonAuthCertificateImageResponse, ModifyPartnerAutoSignAuthUrlRequest, CreateEmployeeQualificationSealQrCodeRequest, DescribeBatchOrganizationRegistrationTasksRequest, ChannelCreateUserAutoSignSealUrlRequest, ChannelCreateUserAutoSignEnableUrlRequest, ChannelCancelMultiFlowSignQRCodeRequest, ChannelDescribeOrganizationSealsRequest, DescribeUsageRequest, DescribeExtendedServiceAuthInfoRequest, CreateCloseOrganizationUrlResponse, DescribeChannelSealPolicyWorkflowUrlRequest, CreatePartnerAutoSignAuthUrlResponse, ArchiveDynamicFlowRequest, ChannelCreateDynamicFlowApproverRequest, ModifyFlowDeadlineResponse, DescribeFlowDetailInfoResponse, ChannelCreateBoundFlowsResponse, ChannelCreateUserAutoSignSealUrlResponse, ChannelCreateBatchQuickSignUrlRequest, ChannelCreateBoundFlowsRequest, ChannelDescribeEmployeesRequest, OperateTemplateResponse, CreateFlowBlockchainEvidenceUrlResponse, ChannelDeleteRoleUsersResponse, SyncProxyOrganizationOperatorsRequest, ChannelCreateFlowApproversResponse, CreateBatchAdminChangeInvitationsUrlResponse, DescribeUsageResponse, CreateSignUrlsRequest, ChannelCreateMultiFlowSignQRCodeRequest, ChannelCreateUserAutoSignEnableUrlResponse, ChannelGetTaskResultApiRequest, DescribeChannelOrganizationsRequest, ChannelDescribeBillUsageDetailResponse, CreateEmployeeChangeUrlResponse, ChannelRenewAutoSignLicenseRequest, ChannelCreatePreparedPersonalEsignRequest, CancelOrganizationFlowsRequest, CreatePersonAuthCertificateImageRequest, PrepareFlowsRequest, CreateFlowsByTemplatesResponse, DescribeChannelFlowEvidenceReportRequest, ChannelCreateRoleResponse, CreateEmployeeChangeUrlRequest, ChannelDescribeUserAutoSignStatusRequest, CreateModifyAdminAuthorizationUrlRequest, ChannelModifyRoleResponse, ModifyOrganizationBusinessInfoRequest, CreateSignUrlsResponse, ChannelDeleteRoleRequest, CreateBatchOrganizationRegistrationTasksRequest, ChannelCreateBatchQuickSignUrlResponse, CreateBatchOrganizationAuthorizationUrlResponse, CreatePartnerAutoSignAuthUrlRequest, DescribeBatchOrganizationRegistrationTasksResponse, ChannelCreateBatchCancelFlowUrlRequest, ChannelDescribeAccountBillDetailResponse, CreateFlowForwardsResponse, ChannelCreateFlowByFilesResponse, ChannelCreateFlowSignReviewResponse, ChannelDisableUserAutoSignRequest, ChannelDescribeOrganizationSealsResponse, SyncProxyOrganizationOperatorsResponse, CreateSealByImageResponse, ChannelCancelMultiFlowSignQRCodeResponse, ChannelDescribeRolesResponse, CreateChannelSubOrganizationActiveResponse, ChannelCreateReleaseFlowRequest, ChannelDescribeFlowComponentsResponse, DeleteOrganizationAuthorizationsRequest, ChannelCreateFlowGroupByFilesResponse, ChannelCreateMultiFlowSignQRCodeResponse, ChannelCreatePrepareFlowGroupResponse, DescribeCancelFlowsTaskRequest, ChannelDescribeUserAutoSignStatusResponse, ModifyExtendedServiceResponse, ChannelCreateUserRolesRequest, ChannelGetTaskResultApiResponse, ChannelCreateBatchSignUrlRequest, ChannelUpdateSealStatusResponse, ChannelCreateOrganizationModifyQrCodeResponse, ChannelDeleteSealPoliciesResponse, ChannelCreateWebThemeConfigResponse, GetDownloadFlowUrlRequest, ChannelCreateEmbedWebUrlResponse, ChannelBatchCancelFlowsRequest, CreateChannelOrganizationInfoChangeUrlRequest, ChannelModifyRoleRequest, ModifyFlowDeadlineRequest, ChannelUpdateSealStatusRequest, ChannelCreateFlowGroupByTemplatesRequest, CreateBatchInitOrganizationUrlRequest, CreateFlowGroupSignReviewRequest, ChannelCancelFlowRequest, DescribeTemplatesRequest, ChannelCreateSealPolicyRequest, CreateBatchAdminChangeInvitationsRequest, CreateFlowsByTemplatesRequest, DescribeBatchOrganizationRegistrationUrlsResponse, UploadFilesRequest, CreateSealByImageRequest, DescribeChannelOrganizationsResponse, ChannelCreateOrganizationBatchSignUrlResponse, CreateBatchOrganizationAuthorizationUrlRequest, ChannelCreateBatchCancelFlowUrlResponse, OperateChannelTemplateRequest, DescribeChannelSealPolicyWorkflowUrlResponse, CreateChannelFlowEvidenceReportResponse, ChannelDescribeAccountBillDetailRequest, ChannelDescribeEmployeesResponse, CreateModifyAdminAuthorizationUrlResponse, ChannelDeleteRoleResponse, ChannelCreateReleaseFlowResponse, SyncProxyOrganizationRequest, DescribeChannelFlowEvidenceReportResponse, ModifyPartnerAutoSignAuthUrlResponse, CreateFlowBlockchainEvidenceUrlRequest, DescribeUserFlowTypeRequest, ChannelCreateFlowApproversRequest, ChannelDescribeBillUsageDetailRequest, ChannelCreateFlowRemindsRequest, DescribeExtendedServiceAuthInfoResponse, CreateFileConvertTaskResponse, ChannelCreateEmbedWebUrlRequest, ChannelDescribeFlowComponentsRequest } from "./essbasic_models";
2
+ import { SyncProxyOrganizationResponse, ChannelCreateConvertTaskApiResponse, CreateBatchAdminChangeInvitationsResponse, ChannelCreateFlowRemindsResponse, DescribeUserFlowTypeResponse, ChannelDeleteSealPoliciesRequest, ChannelBatchCancelFlowsResponse, ChannelDescribeSignFaceVideoRequest, ChannelDisableUserAutoSignResponse, DescribeExtendedServiceAuthDetailResponse, CreateLegalSealQrCodeResponse, DescribeCancelFlowsTaskResponse, CreateEmployeeQualificationSealQrCodeResponse, ChannelCreateFlowGroupByTemplatesResponse, ChannelCreateFlowSignReviewRequest, CreateFlowForwardsRequest, DescribeFlowDetailInfoRequest, ChannelCancelFlowResponse, ModifyExtendedServiceRequest, DescribeResourceUrlsByFlowsRequest, CreateFileConvertTaskRequest, CreateChannelOrganizationInfoChangeUrlResponse, ChannelCreateFlowSignUrlResponse, DescribeFileConvertTaskResponse, ChannelCreateBatchSignUrlResponse, CreateBatchAdminChangeInvitationsUrlRequest, ChannelCreatePrepareFlowResponse, CreateBatchInitOrganizationUrlResponse, OperateChannelTemplateResponse, ChannelCreateDynamicFlowApproverResponse, ChannelCreateRoleRequest, CreateOrganizationAuthFileResponse, CreateConsoleLoginUrlResponse, ChannelDeleteRoleUsersRequest, ChannelCreateUserRolesResponse, ChannelCreatePrepareFlowRequest, ChannelCreateFlowSignUrlRequest, ChannelCreateSealPolicyResponse, OperateTemplateRequest, ChannelDescribeSignFaceVideoResponse, ChannelCancelUserAutoSignEnableUrlResponse, ChannelCreateWebThemeConfigRequest, CancelOrganizationFlowsResponse, CreateFlowGroupSignReviewResponse, ChannelCreateConvertTaskApiRequest, ChannelCreateFlowByFilesRequest, UploadFilesResponse, ChannelCreatePreparedPersonalEsignResponse, DescribeResourceUrlsByFlowsResponse, ChannelCreateFlowGroupByFilesRequest, DescribeFileConvertTaskRequest, ChannelCreateOrganizationModifyQrCodeRequest, CreateChannelSubOrganizationActiveRequest, ChannelRenewAutoSignLicenseResponse, ModifyOrganizationBusinessInfoResponse, ChannelDescribeRolesRequest, DescribeBatchOrganizationRegistrationUrlsRequest, PrepareFlowsResponse, CreateRequestWithEncryptionResponse, ChannelCreateOrganizationBatchSignUrlRequest, GetDownloadFlowUrlResponse, DescribeTemplatesResponse, CreateBatchOrganizationRegistrationTasksResponse, ChannelVerifyPdfRequest, CreateChannelFlowEvidenceReportRequest, ChannelCancelUserAutoSignEnableUrlRequest, DeleteOrganizationAuthorizationsResponse, ChannelCreatePrepareFlowGroupRequest, DescribeExtendedServiceAuthDetailRequest, CreateOrganizationAuthFileRequest, ChannelVerifyPdfResponse, ArchiveDynamicFlowResponse, CreateConsoleLoginUrlRequest, CreateLegalSealQrCodeRequest, CreateCloseOrganizationUrlRequest, CreatePersonAuthCertificateImageResponse, ModifyPartnerAutoSignAuthUrlRequest, CreateEmployeeQualificationSealQrCodeRequest, DescribeBatchOrganizationRegistrationTasksRequest, ChannelCreateUserAutoSignSealUrlRequest, ChannelCreateUserAutoSignEnableUrlRequest, CreateRequestWithEncryptionRequest, ChannelCancelMultiFlowSignQRCodeRequest, ChannelDescribeOrganizationSealsRequest, DescribeUsageRequest, DescribeExtendedServiceAuthInfoRequest, CreateCloseOrganizationUrlResponse, DescribeChannelSealPolicyWorkflowUrlRequest, CreatePartnerAutoSignAuthUrlResponse, ArchiveDynamicFlowRequest, ChannelCreateDynamicFlowApproverRequest, ModifyFlowDeadlineResponse, DescribeFlowDetailInfoResponse, ChannelCreateBoundFlowsResponse, ChannelCreateUserAutoSignSealUrlResponse, ChannelCreateBatchQuickSignUrlRequest, ChannelCreateBoundFlowsRequest, ChannelDescribeEmployeesRequest, OperateTemplateResponse, CreateFlowBlockchainEvidenceUrlResponse, ChannelDeleteRoleUsersResponse, SyncProxyOrganizationOperatorsRequest, ChannelCreateFlowApproversResponse, CreateBatchAdminChangeInvitationsUrlResponse, DescribeUsageResponse, CreateSignUrlsRequest, ChannelCreateMultiFlowSignQRCodeRequest, ChannelCreateUserAutoSignEnableUrlResponse, ChannelGetTaskResultApiRequest, DescribeChannelOrganizationsRequest, ChannelDescribeBillUsageDetailResponse, CreateEmployeeChangeUrlResponse, ChannelRenewAutoSignLicenseRequest, ChannelCreatePreparedPersonalEsignRequest, CancelOrganizationFlowsRequest, CreatePersonAuthCertificateImageRequest, PrepareFlowsRequest, CreateFlowsByTemplatesResponse, DescribeChannelFlowEvidenceReportRequest, ChannelCreateRoleResponse, CreateEmployeeChangeUrlRequest, ChannelDescribeUserAutoSignStatusRequest, CreateModifyAdminAuthorizationUrlRequest, ChannelModifyRoleResponse, ModifyOrganizationBusinessInfoRequest, CreateSignUrlsResponse, ChannelDeleteRoleRequest, CreateBatchOrganizationRegistrationTasksRequest, ChannelCreateBatchQuickSignUrlResponse, CreateBatchOrganizationAuthorizationUrlResponse, CreatePartnerAutoSignAuthUrlRequest, DescribeBatchOrganizationRegistrationTasksResponse, ChannelCreateBatchCancelFlowUrlRequest, ChannelDescribeAccountBillDetailResponse, CreateFlowForwardsResponse, ChannelCreateFlowByFilesResponse, ChannelCreateFlowSignReviewResponse, ChannelDisableUserAutoSignRequest, ChannelDescribeOrganizationSealsResponse, SyncProxyOrganizationOperatorsResponse, CreateSealByImageResponse, ChannelCancelMultiFlowSignQRCodeResponse, ChannelDescribeRolesResponse, CreateChannelSubOrganizationActiveResponse, ChannelCreateReleaseFlowRequest, ChannelDescribeFlowComponentsResponse, DeleteOrganizationAuthorizationsRequest, ChannelCreateFlowGroupByFilesResponse, ChannelCreateMultiFlowSignQRCodeResponse, ChannelCreatePrepareFlowGroupResponse, DescribeCancelFlowsTaskRequest, ChannelDescribeUserAutoSignStatusResponse, ModifyExtendedServiceResponse, ChannelCreateUserRolesRequest, ChannelGetTaskResultApiResponse, ChannelCreateBatchSignUrlRequest, ChannelUpdateSealStatusResponse, ChannelCreateOrganizationModifyQrCodeResponse, ChannelDeleteSealPoliciesResponse, ChannelCreateWebThemeConfigResponse, GetDownloadFlowUrlRequest, ChannelCreateEmbedWebUrlResponse, ChannelBatchCancelFlowsRequest, CreateChannelOrganizationInfoChangeUrlRequest, ChannelModifyRoleRequest, ModifyFlowDeadlineRequest, ChannelUpdateSealStatusRequest, ChannelCreateFlowGroupByTemplatesRequest, CreateBatchInitOrganizationUrlRequest, CreateFlowGroupSignReviewRequest, ChannelCancelFlowRequest, DescribeTemplatesRequest, ChannelCreateSealPolicyRequest, CreateBatchAdminChangeInvitationsRequest, CreateFlowsByTemplatesRequest, DescribeBatchOrganizationRegistrationUrlsResponse, UploadFilesRequest, CreateSealByImageRequest, DescribeChannelOrganizationsResponse, ChannelCreateOrganizationBatchSignUrlResponse, CreateBatchOrganizationAuthorizationUrlRequest, ChannelCreateBatchCancelFlowUrlResponse, OperateChannelTemplateRequest, DescribeChannelSealPolicyWorkflowUrlResponse, CreateChannelFlowEvidenceReportResponse, ChannelDescribeAccountBillDetailRequest, ChannelDescribeEmployeesResponse, CreateModifyAdminAuthorizationUrlResponse, ChannelDeleteRoleResponse, ChannelCreateReleaseFlowResponse, SyncProxyOrganizationRequest, DescribeChannelFlowEvidenceReportResponse, ModifyPartnerAutoSignAuthUrlResponse, CreateFlowBlockchainEvidenceUrlRequest, DescribeUserFlowTypeRequest, ChannelCreateFlowApproversRequest, ChannelDescribeBillUsageDetailRequest, ChannelCreateFlowRemindsRequest, DescribeExtendedServiceAuthInfoResponse, CreateFileConvertTaskResponse, ChannelCreateEmbedWebUrlRequest, ChannelDescribeFlowComponentsRequest } from "./essbasic_models";
3
3
  /**
4
4
  * essbasic client
5
5
  * @class
@@ -636,12 +636,126 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
636
636
  */
637
637
  CreateBatchInitOrganizationUrl(req: CreateBatchInitOrganizationUrlRequest, cb?: (error: string, rep: CreateBatchInitOrganizationUrlResponse) => void): Promise<CreateBatchInitOrganizationUrlResponse>;
638
638
  /**
639
- * 通过此接口(ChannelDescribeAccountBillDetail)查询该第三方平台子客账号绑定中、剩余可绑定账号等套餐使用情况。
640
- <ul>
641
- <li>对于渠道客户企业的查询,通过指定渠道企业的唯一标识(Agent.ProxyOrganizationId)来查询“子客账号”套餐消耗详情</li>
642
- </ul>
639
+ * 该接口支持对请求内容进行加密传输。调用方需使用约定的 AES-CBC 或 SM4-CBC 算法对请求内容进行加密,并使用 HMAC-SHA256 或 HMAC-SM3 算法对 IV 和加密后的数据进行完整性校验,防止请求内容被篡改。
640
+
641
+ ![image](https://qcloudimg.tencent-cloud.cn/raw/391df0a37c2b213445c4909ba98824ac.svg)
642
+
643
+ **请求端加密流程**
644
+ 1. 每次请求使用密码学安全的随机源生成 16 字节 的 IV。每次请求必须重新生成,严禁复用。
645
+ 2. 使用约定的 AES-CBC 或 SM4-CBC 算法对原始请求体进行加密,使用 PKCS#7 Padding。
646
+ 3. 将加密后的密文原始字节进行标准 Base64 编码,作为 EncryptedData 参数。
647
+ 4. 将 IV 原始字节进行标准 Base64 编码,作为 IV 参数。
648
+ 5. 对 IV 原始字节和密文原始字节直接拼接(不添加分隔符),计算 HMAC-SHA256 或 HMAC-SM4:HMAC(Key, IVBytes || CiphertextBytes)
649
+ 6. 将 HMAC 的结果进行 标准 Base64 编码,作为 EncryptionSignature 参数。
650
+
651
+ **响应端解密流程**
652
+ 1. 先判断本接口自身是否返回外层错误,此时错误为明文(标准腾讯云错误体),有则直接失败处理。
653
+ 2. 分别对 IV、EncryptedData、EncryptionSignature 做标准 Base64 解码,得到原始字节。
654
+ 3. 将 IV 与密文原始字节直接拼接(无分隔符),计算 HMAC-SHA256 或 HMAC-SM4:HMAC(Key, IVBytes || CiphertextBytes)。
655
+ 4. 与响应中 EncryptionSignature 解码后的字节做恒定时间比较,不一致立即失败,不得继续解密。
656
+ 5. 使用约定的 AES-CBC 或 SM4-CBC,以 IV 和密钥解密 EncryptedData,去除 PKCS#7 Padding 得到明文。
657
+ 6. 先用腾讯云标准错误体反序列化明文,判断被加密业务接口是否返回 Error。
658
+ 7. 无业务错误时,再用目标业务接口的响应结构体反序列化明文,取出实际业务参数。
659
+
660
+ **响应端错误处理**
661
+ 1. 外层错误(本接口本身调用失败):返回标准腾讯云错误 JSON(含 Error.Code / Error.Message),无 EncryptedData,不需要解密即可处理。
662
+ 2. 内层错误(业务接口执行失败):外层成功,但解密后的明文里包含 Error.Code / Error.Message,按目标业务接口的错误规范处理。
663
+
664
+ **处理过程示例**
665
+ ```
666
+ # ========== 前置约定 ==========
667
+ AESKey : 加密 密钥(AES 32 字节,SM4 16 字节)
668
+ HMACKey : HMAC 密钥(与加密密钥需要不同)
669
+ ALGO : AES-CBC 或 SM4-CBC,双方约定
670
+ HMAC : ALGO == AES-CBC ? HMAC-SHA256 : HMAC-SM3
671
+
672
+ # ========== 请求端:加密并调用 ==========
673
+ function CallWithEncryption(bizAction, bizApplicationId, bizRequestObj):
674
+ # 1. 序列化业务请求
675
+ plaintext = JSON.stringify(bizRequestObj)
676
+ # 2. 生成 16 字节随机 IV(每次新生成,禁止复用)
677
+ iv = SecureRandom(16)
678
+ # 3. 对称加密(PKCS#7 Padding)
679
+ ciphertext = SymmetricEncrypt(ALGO, AESKey, iv, plaintext)
680
+ # 4. 计算完整性签名:HMAC(Key, IV || Ciphertext)
681
+ signature = HMAC(HMACKey, concat(iv, ciphertext))
682
+ # 5. 组装外层请求参数(三段均为标准 Base64)
683
+ encReq = {
684
+ RequestAction: bizAction,
685
+ ApplicationId: bizApplicationId,
686
+ IV: Base64(iv),
687
+ EncryptedData: Base64(ciphertext),
688
+ EncryptionSignature: Base64(signature),
689
+ }
690
+ # 6. 调用 CreateRequestWithEncryption
691
+ # TC3-HMAC-SHA256 鉴权由官方 SDK 自动完成
692
+ encResp = CloudAPI.CreateRequestWithEncryption(encReq)
693
+ # 7. 外层错误:明文,直接抛出
694
+ if encResp.Error != nil:
695
+ raise OuterError(encResp.Error)
696
+ # 8. 解密并返回业务响应
697
+ return DecryptResponse(encResp.Response)
698
+
699
+ # ========== 响应端:校验并解密 ==========
700
+ function DecryptResponse(resp):
701
+ # 1. Base64 解码
702
+ ivBytes = Base64Decode(resp.IV)
703
+ ctBytes = Base64Decode(resp.EncryptedData)
704
+ sigBytes = Base64Decode(resp.EncryptionSignature)
705
+ # 2. 重新计算 HMAC
706
+ expected = HMAC(HMACKey, concat(ivBytes, ctBytes))
707
+ # 3. 恒定时间比较,失败立即终止(不得继续解密)
708
+ if not ConstantTimeEqual(expected, sigBytes):
709
+ raise SignatureMismatch
710
+ # 4. 对称解密,去除 PKCS#7 Padding
711
+ plaintext = SymmetricDecrypt(ALGO, AESKey, ivBytes, ctBytes)
712
+ # 5. 先按腾讯云错误体解析,判断业务是否失败
713
+ bizErr = TryParseTencentCloudError(plaintext)
714
+ if bizErr != nil:
715
+ raise BusinessError(bizErr)
716
+ # 6. 按目标业务接口的响应结构反序列化
717
+ return JSON.parse(plaintext, BizResponseSchema)
718
+ ```
719
+
720
+ **AES-CBC 示例**
721
+ 以下示例参数及结果可用于验证 AES-CBC 加密和 HMAC-SHA256 签名算法的实现是否正确。
722
+
723
+ 加密密钥:AES-CBC-Key-1234
724
+ 签名密钥:AES-HMAC-Key-123
725
+ IV:1234567890abcdef
726
+ 请求内容:{"Request": "This is a test."}
727
+
728
+ 最终请求参数:
729
+ ```
730
+ {
731
+ "RequestAction": "DescribeFlowComponents",
732
+ "ApplicationId: "yD******************************,
733
+ "IV": "MTIzNDU2Nzg5MGFiY2RlZg==",
734
+ "EncryptedData": "Iqp2W1jislwMNmE7bH9dKZZiMQsfkAPyvAAqDFRnWLw=",
735
+ "EncryptionSignature": "4TT3PUCZgZT7YmEPtXDm5PDcM6xT7FoYHfMW8xunB5I="
736
+ }
737
+ ```
738
+
739
+ **SM4-CBC 示例**
740
+ 以下示例参数及结果可用于验证 SM4-CBC 加密和 HMAC-SM4 签名算法的实现是否正确。
741
+
742
+ 加密密钥:SM4-CBC-Key-1234
743
+ 签名密钥:SM4-HMAC-Key-123
744
+ IV:fedcba0987654321
745
+ 请求内容:{"Request": "This is a test."}
746
+
747
+ 最终请求参数:
748
+ ```
749
+ {
750
+ "RequestAction": "DescribeFlowComponents",
751
+ "ApplicationId: "yD******************************,
752
+ "IV": "ZmVkY2JhMDk4NzY1NDMyMQ==",
753
+ "EncryptedData": "GwUovQhNUPaUnVM/UDXMtPOYTpTSi2B1oyZDFbyyvns=",
754
+ "EncryptionSignature": "nHB/v/AvOaDCQ66esFNnp12lHKcGkwaLGid0Warl/KE="
755
+ }
756
+ ```
643
757
  */
644
- ChannelDescribeAccountBillDetail(req: ChannelDescribeAccountBillDetailRequest, cb?: (error: string, rep: ChannelDescribeAccountBillDetailResponse) => void): Promise<ChannelDescribeAccountBillDetailResponse>;
758
+ CreateRequestWithEncryption(req: CreateRequestWithEncryptionRequest, cb?: (error: string, rep: CreateRequestWithEncryptionResponse) => void): Promise<CreateRequestWithEncryptionResponse>;
645
759
  /**
646
760
  * 您可以通过合同流程ID查询相关的<font color="red"><b>填写控件</b></font>信息及其内容。这包括控件的归属方、控件的填写状态(是否已填写)以及具体的填写内容。
647
761
 
@@ -1131,6 +1245,13 @@ export declare class Client extends TencentCloudCommon.AbstractClient {
1131
1245
  **这个接口的操作人必须跟生成批量认证链接接口的应用号一致,才可以调用,否则会返回当前操作人没有认证中的企业认证流**
1132
1246
  */
1133
1247
  DeleteOrganizationAuthorizations(req: DeleteOrganizationAuthorizationsRequest, cb?: (error: string, rep: DeleteOrganizationAuthorizationsResponse) => void): Promise<DeleteOrganizationAuthorizationsResponse>;
1248
+ /**
1249
+ * 通过此接口(ChannelDescribeAccountBillDetail)查询该第三方平台子客账号绑定中、剩余可绑定账号等套餐使用情况。
1250
+ <ul>
1251
+ <li>对于渠道客户企业的查询,通过指定渠道企业的唯一标识(Agent.ProxyOrganizationId)来查询“子客账号”套餐消耗详情</li>
1252
+ </ul>
1253
+ */
1254
+ ChannelDescribeAccountBillDetail(req: ChannelDescribeAccountBillDetailRequest, cb?: (error: string, rep: ChannelDescribeAccountBillDetailResponse) => void): Promise<ChannelDescribeAccountBillDetailResponse>;
1134
1255
  /**
1135
1256
  * 在已启动的签署流程中,可对签署截止日期进行延期操作,主要分为以下两个层面:
1136
1257
  1. <b> 合同(流程)层面</b>:仅需提供签署流程ID。此操作将对整个签署流程以及未单独设置签署截止时间的签署人进行延期。
@@ -746,13 +746,127 @@ class Client extends TencentCloudCommon.AbstractClient {
746
746
  return this.request("CreateBatchInitOrganizationUrl", req, cb);
747
747
  }
748
748
  /**
749
- * 通过此接口(ChannelDescribeAccountBillDetail)查询该第三方平台子客账号绑定中、剩余可绑定账号等套餐使用情况。
750
- <ul>
751
- <li>对于渠道客户企业的查询,通过指定渠道企业的唯一标识(Agent.ProxyOrganizationId)来查询“子客账号”套餐消耗详情</li>
752
- </ul>
749
+ * 该接口支持对请求内容进行加密传输。调用方需使用约定的 AES-CBC 或 SM4-CBC 算法对请求内容进行加密,并使用 HMAC-SHA256 或 HMAC-SM3 算法对 IV 和加密后的数据进行完整性校验,防止请求内容被篡改。
750
+
751
+ ![image](https://qcloudimg.tencent-cloud.cn/raw/391df0a37c2b213445c4909ba98824ac.svg)
752
+
753
+ **请求端加密流程**
754
+ 1. 每次请求使用密码学安全的随机源生成 16 字节 的 IV。每次请求必须重新生成,严禁复用。
755
+ 2. 使用约定的 AES-CBC 或 SM4-CBC 算法对原始请求体进行加密,使用 PKCS#7 Padding。
756
+ 3. 将加密后的密文原始字节进行标准 Base64 编码,作为 EncryptedData 参数。
757
+ 4. 将 IV 原始字节进行标准 Base64 编码,作为 IV 参数。
758
+ 5. 对 IV 原始字节和密文原始字节直接拼接(不添加分隔符),计算 HMAC-SHA256 或 HMAC-SM4:HMAC(Key, IVBytes || CiphertextBytes)
759
+ 6. 将 HMAC 的结果进行 标准 Base64 编码,作为 EncryptionSignature 参数。
760
+
761
+ **响应端解密流程**
762
+ 1. 先判断本接口自身是否返回外层错误,此时错误为明文(标准腾讯云错误体),有则直接失败处理。
763
+ 2. 分别对 IV、EncryptedData、EncryptionSignature 做标准 Base64 解码,得到原始字节。
764
+ 3. 将 IV 与密文原始字节直接拼接(无分隔符),计算 HMAC-SHA256 或 HMAC-SM4:HMAC(Key, IVBytes || CiphertextBytes)。
765
+ 4. 与响应中 EncryptionSignature 解码后的字节做恒定时间比较,不一致立即失败,不得继续解密。
766
+ 5. 使用约定的 AES-CBC 或 SM4-CBC,以 IV 和密钥解密 EncryptedData,去除 PKCS#7 Padding 得到明文。
767
+ 6. 先用腾讯云标准错误体反序列化明文,判断被加密业务接口是否返回 Error。
768
+ 7. 无业务错误时,再用目标业务接口的响应结构体反序列化明文,取出实际业务参数。
769
+
770
+ **响应端错误处理**
771
+ 1. 外层错误(本接口本身调用失败):返回标准腾讯云错误 JSON(含 Error.Code / Error.Message),无 EncryptedData,不需要解密即可处理。
772
+ 2. 内层错误(业务接口执行失败):外层成功,但解密后的明文里包含 Error.Code / Error.Message,按目标业务接口的错误规范处理。
773
+
774
+ **处理过程示例**
775
+ ```
776
+ # ========== 前置约定 ==========
777
+ AESKey : 加密 密钥(AES 32 字节,SM4 16 字节)
778
+ HMACKey : HMAC 密钥(与加密密钥需要不同)
779
+ ALGO : AES-CBC 或 SM4-CBC,双方约定
780
+ HMAC : ALGO == AES-CBC ? HMAC-SHA256 : HMAC-SM3
781
+
782
+ # ========== 请求端:加密并调用 ==========
783
+ function CallWithEncryption(bizAction, bizApplicationId, bizRequestObj):
784
+ # 1. 序列化业务请求
785
+ plaintext = JSON.stringify(bizRequestObj)
786
+ # 2. 生成 16 字节随机 IV(每次新生成,禁止复用)
787
+ iv = SecureRandom(16)
788
+ # 3. 对称加密(PKCS#7 Padding)
789
+ ciphertext = SymmetricEncrypt(ALGO, AESKey, iv, plaintext)
790
+ # 4. 计算完整性签名:HMAC(Key, IV || Ciphertext)
791
+ signature = HMAC(HMACKey, concat(iv, ciphertext))
792
+ # 5. 组装外层请求参数(三段均为标准 Base64)
793
+ encReq = {
794
+ RequestAction: bizAction,
795
+ ApplicationId: bizApplicationId,
796
+ IV: Base64(iv),
797
+ EncryptedData: Base64(ciphertext),
798
+ EncryptionSignature: Base64(signature),
799
+ }
800
+ # 6. 调用 CreateRequestWithEncryption
801
+ # TC3-HMAC-SHA256 鉴权由官方 SDK 自动完成
802
+ encResp = CloudAPI.CreateRequestWithEncryption(encReq)
803
+ # 7. 外层错误:明文,直接抛出
804
+ if encResp.Error != nil:
805
+ raise OuterError(encResp.Error)
806
+ # 8. 解密并返回业务响应
807
+ return DecryptResponse(encResp.Response)
808
+
809
+ # ========== 响应端:校验并解密 ==========
810
+ function DecryptResponse(resp):
811
+ # 1. Base64 解码
812
+ ivBytes = Base64Decode(resp.IV)
813
+ ctBytes = Base64Decode(resp.EncryptedData)
814
+ sigBytes = Base64Decode(resp.EncryptionSignature)
815
+ # 2. 重新计算 HMAC
816
+ expected = HMAC(HMACKey, concat(ivBytes, ctBytes))
817
+ # 3. 恒定时间比较,失败立即终止(不得继续解密)
818
+ if not ConstantTimeEqual(expected, sigBytes):
819
+ raise SignatureMismatch
820
+ # 4. 对称解密,去除 PKCS#7 Padding
821
+ plaintext = SymmetricDecrypt(ALGO, AESKey, ivBytes, ctBytes)
822
+ # 5. 先按腾讯云错误体解析,判断业务是否失败
823
+ bizErr = TryParseTencentCloudError(plaintext)
824
+ if bizErr != nil:
825
+ raise BusinessError(bizErr)
826
+ # 6. 按目标业务接口的响应结构反序列化
827
+ return JSON.parse(plaintext, BizResponseSchema)
828
+ ```
829
+
830
+ **AES-CBC 示例**
831
+ 以下示例参数及结果可用于验证 AES-CBC 加密和 HMAC-SHA256 签名算法的实现是否正确。
832
+
833
+ 加密密钥:AES-CBC-Key-1234
834
+ 签名密钥:AES-HMAC-Key-123
835
+ IV:1234567890abcdef
836
+ 请求内容:{"Request": "This is a test."}
837
+
838
+ 最终请求参数:
839
+ ```
840
+ {
841
+ "RequestAction": "DescribeFlowComponents",
842
+ "ApplicationId: "yD******************************,
843
+ "IV": "MTIzNDU2Nzg5MGFiY2RlZg==",
844
+ "EncryptedData": "Iqp2W1jislwMNmE7bH9dKZZiMQsfkAPyvAAqDFRnWLw=",
845
+ "EncryptionSignature": "4TT3PUCZgZT7YmEPtXDm5PDcM6xT7FoYHfMW8xunB5I="
846
+ }
847
+ ```
848
+
849
+ **SM4-CBC 示例**
850
+ 以下示例参数及结果可用于验证 SM4-CBC 加密和 HMAC-SM4 签名算法的实现是否正确。
851
+
852
+ 加密密钥:SM4-CBC-Key-1234
853
+ 签名密钥:SM4-HMAC-Key-123
854
+ IV:fedcba0987654321
855
+ 请求内容:{"Request": "This is a test."}
856
+
857
+ 最终请求参数:
858
+ ```
859
+ {
860
+ "RequestAction": "DescribeFlowComponents",
861
+ "ApplicationId: "yD******************************,
862
+ "IV": "ZmVkY2JhMDk4NzY1NDMyMQ==",
863
+ "EncryptedData": "GwUovQhNUPaUnVM/UDXMtPOYTpTSi2B1oyZDFbyyvns=",
864
+ "EncryptionSignature": "nHB/v/AvOaDCQ66esFNnp12lHKcGkwaLGid0Warl/KE="
865
+ }
866
+ ```
753
867
  */
754
- async ChannelDescribeAccountBillDetail(req, cb) {
755
- return this.request("ChannelDescribeAccountBillDetail", req, cb);
868
+ async CreateRequestWithEncryption(req, cb) {
869
+ return this.request("CreateRequestWithEncryption", req, cb);
756
870
  }
757
871
  /**
758
872
  * 您可以通过合同流程ID查询相关的<font color="red"><b>填写控件</b></font>信息及其内容。这包括控件的归属方、控件的填写状态(是否已填写)以及具体的填写内容。
@@ -1301,6 +1415,15 @@ class Client extends TencentCloudCommon.AbstractClient {
1301
1415
  async DeleteOrganizationAuthorizations(req, cb) {
1302
1416
  return this.request("DeleteOrganizationAuthorizations", req, cb);
1303
1417
  }
1418
+ /**
1419
+ * 通过此接口(ChannelDescribeAccountBillDetail)查询该第三方平台子客账号绑定中、剩余可绑定账号等套餐使用情况。
1420
+ <ul>
1421
+ <li>对于渠道客户企业的查询,通过指定渠道企业的唯一标识(Agent.ProxyOrganizationId)来查询“子客账号”套餐消耗详情</li>
1422
+ </ul>
1423
+ */
1424
+ async ChannelDescribeAccountBillDetail(req, cb) {
1425
+ return this.request("ChannelDescribeAccountBillDetail", req, cb);
1426
+ }
1304
1427
  /**
1305
1428
  * 在已启动的签署流程中,可对签署截止日期进行延期操作,主要分为以下两个层面:
1306
1429
  1. <b> 合同(流程)层面</b>:仅需提供签署流程ID。此操作将对整个签署流程以及未单独设置签署截止时间的签署人进行延期。
@@ -2451,6 +2451,27 @@ export interface PrepareFlowsResponse {
2451
2451
  */
2452
2452
  RequestId?: string;
2453
2453
  }
2454
+ /**
2455
+ * CreateRequestWithEncryption返回参数结构体
2456
+ */
2457
+ export interface CreateRequestWithEncryptionResponse {
2458
+ /**
2459
+ * <p>加密算法使用的初始化向量。固定为 16 字节,将 IV 原始字节使用标准 Base64 编码后传入。</p>
2460
+ */
2461
+ IV?: string;
2462
+ /**
2463
+ * <p>使用 AES-CBC 或 SM4-CBC 加密返回内容得到的密文。加密前返回内容采用 PKCS#7 Padding;将密文原始字节使用标准 Base64 编码后传入。</p>
2464
+ */
2465
+ EncryptedData?: string;
2466
+ /**
2467
+ * <p>用于校验请求数据完整性。对 IV 原始字节和密文原始字节直接拼接(不加拼接符)后计算 HMAC-SHA256,再将计算结果使用标准 Base64 编码后传入。</p>
2468
+ */
2469
+ EncryptionSignature?: string;
2470
+ /**
2471
+ * 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
2472
+ */
2473
+ RequestId?: string;
2474
+ }
2454
2475
  /**
2455
2476
  * 流程签署二维码的签署信息,适用于客户系统整合二维码功能。 通过链接,用户可直接访问电子签名小程序并签署合同。
2456
2477
  */
@@ -4087,6 +4108,31 @@ export interface ChannelCreateUserAutoSignEnableUrlRequest {
4087
4108
  */
4088
4109
  EndPoint?: string;
4089
4110
  }
4111
+ /**
4112
+ * CreateRequestWithEncryption请求参数结构体
4113
+ */
4114
+ export interface CreateRequestWithEncryptionRequest {
4115
+ /**
4116
+ * <p>操作的接口名称。取值参考接口文档输入参数章节关于公共参数 Action 的说明。</p>
4117
+ */
4118
+ RequestAction: string;
4119
+ /**
4120
+ * <p>第三方应用的唯一标识,对应通用参数 Agent.AppId。</p>
4121
+ */
4122
+ ApplicationId: string;
4123
+ /**
4124
+ * <p>加密算法使用的初始化向量。固定为 16 字节,将 IV 原始字节使用标准 Base64 编码后传入。</p>
4125
+ */
4126
+ IV: string;
4127
+ /**
4128
+ * <p>使用 AES-CBC 或 SM4-CBC 加密请求内容得到的密文。加密前请求内容采用 PKCS#7 Padding;将密文原始字节使用标准 Base64 编码后传入。</p>
4129
+ */
4130
+ EncryptedData: string;
4131
+ /**
4132
+ * <p>用于校验请求数据完整性。对 IV 原始字节和密文原始字节直接拼接(不加拼接符)后计算 HMAC-SHA256,再将计算结果使用标准 Base64 编码后传入。</p>
4133
+ */
4134
+ EncryptionSignature?: string;
4135
+ }
4090
4136
  /**
4091
4137
  * ChannelCancelMultiFlowSignQRCode请求参数结构体
4092
4138
  */