tencent cloud

PostQuantumCryptoDecrypt
最后更新时间:2025-12-04 15:44:09
PostQuantumCryptoDecrypt
最后更新时间: 2025-12-04 15:44:09

1. API Description

Domain name for API request: kms.intl.tencentcloudapi.com.

This API is used to decrypt ciphertext using post-quantum cryptography (PQC) algorithm, and return the plaintext.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: PostQuantumCryptoDecrypt.
Version Yes String Common Params. The value used for this API: 2019-01-18.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
CiphertextBlob Yes String The ciphertext data to be decrypted.
EncryptionPublicKey No String PEM-encoded public key (2048-bit RSA/SM2 key), which can be used to encrypt the Plaintext returned. If this field is left empty, the Plaintext will not be encrypted.
EncryptionAlgorithm No String Asymmetric encryption algorithm. It is used in combination with EncryptionPublicKey to encrypt the returned data. Values: SM2(Return the ciphertext in the format of "C1C3C2"), SM2_C1C3C2_ASN1 (Return the ciphertext in the format of "C1C3C2 ASN1"), RSAES_PKCS1_V1_5, RSAES_OAEP_SHA_1, RSAES_OAEP_SHA_256. It defaults to SM2 if it's not specified.

3. Output Parameters

Parameter Name Type Description
KeyId String Globally unique CMK ID
PlainText String If EncryptionPublicKey is left empty, a Base64-encoded ciphertext will be returned. To get the plaintext, you need to decode the ciphertext first.
If EncryptionPublicKey is passed in, this field contains the Base64-encoded ciphertext after asymmetric encryption by using the public key in EncryptionPublicKey To get the plaintext, you need to first decode the Base64 format, and then decrypwith the private key corresponding with the public key. The private key is uploaded by the user.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Decrypting with Post-Quantum Cryptography Algorithm

This example shows you how to decrypt using PQC.

Input Example

POST / HTTP/1.1
Host: kms.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: PostQuantumCryptoDecrypt
<Common request parameters>

{
    "CiphertextBlob": "Ade234dasdeEWdGVzdCUyMHBsYWlJJlIHL",
    "EncryptionPublicKey": "-----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYI******VWhjH2dhziiH/NWCkk3FjIhjIwqjmnWhmUTg== -----END PUBLIC KEY----- ",
    "EncryptionAlgorithm": "SM2"
}

Output Example

{
    "Response": {
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b01",
        "PlainText": "dGVzdCUyMHBsYWluJTIwdGV4dA==",
        "RequestId": "cc8f9b3c-620d-4a25-9fb5-decd94357bd8"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation.EncryptionError Encryption failed.
InternalError Internal error.
InvalidParameter Invalid parameter.
InvalidParameterValue.InvalidCiphertext Incorrect ciphertext format
ResourceUnavailable.CmkDisabled The CMK has been disabled.
ResourceUnavailable.CmkNotFound The CMK does not exist.
UnauthorizedOperation Unauthorized operation.
本页内容是否解决了您的问题?
您也可以 联系销售 提交工单 以寻求帮助。

文档反馈