tencent cloud

Feedback

PostQuantumCryptoEncrypt

Last updated: 2023-08-07 17:45:14

1. API Description

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

u200dThis API u200dis 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.

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: 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.

3. Output Parameters

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, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Encrypting with PQC

This example shows you how to encrypt using PQC.

Input Example

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

{
    "KeyId": "abc",
    "PlainText": "abc"
}

Output Example

{
    "Response": {
        "CiphertextBlob": "abc",
        "KeyId": "abc",
        "RequestId": "abc"
    }
}

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
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.