Decrypt

Last updated: 2019-09-09 21:26:46

1. API Description

API domain name: kms.tencentcloudapi.com

This API decrypts ciphertext to get plaintext data.

API request rate limit: 300 requests/sec.

2. Input Parameters

The list below contains only the API request parameters and certain common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter name Required Type Description
Action Yes String Common parameter. The value used for this API: Decrypt
Version Yes String Common parameter. The version of this API: 2019-01-18
Region Yes String Common parameter. For more information, see the List of Regions supported by the product.
CiphertextBlob Yes String Encrypted ciphertext data
EncryptionContext No String key-value pair JSON string. If this parameter is specified for Encrypt, the same parameter needs to be provided to call API Decrypt. The maximum value allowed is 1,024 characters

3. Output Parameters

Parameter name Type Description
KeyId String Globally unique ID of the CMK
Plaintext String Decrypted plaintext. This field is Base64-encoded. You need to Base64-decode the plaintext to get the original plaintext.
RequestId String Unique ID of the request. Each request returns a unique ID. The RequestId is required to troubleshoot issues.

4. Examples

Example 1. Decrypting

Used to decrypt ciphertext.

Input Sample Code

https://kms.tencentcloudapi.com/?Action=Decrypt
&CiphertextBlob=Ade234dasdeEWdGVzdCUyMHBsYWlJJlIHL
&<Common request parameter>

Output Sample Code

{
  "Response": {
    "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b01",
    "Plaintext": "dGVzdCUyMHBsYWluJTIwdGV4dA==",
    "RequestId": "1b580852-1e38-11e9-b129-5cb9019b4b00"
  }
}

5. Developer Resources

API Explorer

This tool makes it easy for you to call Tencent Cloud APIs, authenticate signature, generate SDK codes, and search for APIs.

SDK

TencentCloud API 3.0 integrates software development toolkits (SDKs) for various programming languages, facilitating API calls.

TCCLI

6. Error Codes

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

Error Code Description
InternalError Internal error.
InvalidParameter Incorrect parameter.
InvalidParameterValue.InvalidCiphertext The ciphertext is in incorrect format.
ResourceUnavailable.CmkDisabled The CMK has been disabled.
ResourceUnavailable.CmkNotFound The CMK does not exist.
UnauthorizedOperation Unauthorized operation.