Domain name for API request: kms.tencentcloudapi.com.
This API is used to encrypt using PQC. It supports up to 4 KB of data. It is applicable for encryption of database passwords, RSA keys, or other sensitive information. You can also apply DataKey
generated by API GenerateDataKey
to encrypt or decrypt your local data.
A maximum of 20 requests can be initiated per second for this API.
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: PostQuantumCryptoEncrypt. |
Version | Yes | String | Common Params. The value used for this API: 2019-01-18. |
Region | No | String | Common Params. This parameter is not required for this API. |
KeyId | Yes | String | Globally unique ID of the CMK generated by calling the CreateKey API |
PlainText | Yes | String | Encrypted plaintext data. This field must be Base64-encoded. The maximum size of the original data is 4 KB. |
Parameter Name | Type | Description |
---|---|---|
CiphertextBlob | String | Base64-encoded ciphertext after encryption. This field contains the information of ciphertext and keys. It is not the result of encrypting the plaintext. To get the plaintext, you need to pass in this field to the PostQuantumCryptoDecrypt API. |
KeyId | String | Globally unique ID of the CMK used for encryption |
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. |
This example shows you how to encrypt using PQC.
POST / HTTP/1.1
Host: kms.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: PostQuantumCryptoEncrypt
<Common request parameters>
{
"KeyId": "abc",
"PlainText": "abc"
}
{
"Response": {
"CiphertextBlob": "abc",
"KeyId": "abc",
"RequestId": "abc"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Error Code | Description |
---|---|
InternalError | Internal error. |
InvalidParameter | Invalid parameter. |
InvalidParameterValue.InvalidKeyId | Invalid KeyId . |
InvalidParameterValue.InvalidPlaintext | Invalid Plaintext . |
ResourceUnavailable.CmkArchived | The CMK has been archived. |
ResourceUnavailable.CmkDisabled | The CMK has been disabled. |
ResourceUnavailable.CmkNotFound | The CMK does not exist. |
UnauthorizedOperation | Unauthorized operation. |
Was this page helpful?