You can call this operation to decrypt ciphertext.

The ciphertext to be decrypted can be generated with the following API operations:

Request parameters

Parameter Type Required Description
CiphertextBlob String Yes The ciphertext to be decrypted.
EncryptionContext String No The JSON string of the key-value pair. If you specify this parameter in the Encrypt or GenerateDataKey API operation, it is also required when you call the Decrypt API operation. For more information, see Encryption Context.

Response parameters

Parameter Type Decription
KeyId String The globally unique ID of the CMK. It is the ID of the CMK used to decrypt ciphertext.
KeyVersionId String The ID of the key version used to decrypt ciphertext.
Plaintext String The decrypted plaintext.

Examples

Sample requests

https://kms.cn-hangzhou.aliyuncs.com/?Action=Decrypt
&CiphertextBlob=<your ciphertextblob>
&EncryptionContext={"Example":"Example"}
&<Common request parameters>     

Sample responses

JSON format

//json response
{
    "KeyId": "202b9877-5a25-46e3-a763-e20791b5****",
    "KeyVersionId": "2ab1a983-7072-4bbc-a582-584b5bd8****",
    "Plaintext": "Plaintext",
    "RequestId": "207596a2-36d3-4840-b1bd-f87044699bd7"
}     

XML format

//xml response
<KMS>
        <KeyId>202b9877-5a25-46e3-a763-e20791b5****</KeyId>
        <KeyVersionId>2ab1a983-7072-4bbc-a582-584b5bd8****</KeyVersionId>
        <Plaintext>Plaintext</Plaintext>
        <RequestId>4bd560a1-729e-45f1-a3d9-b2a33d61046b</RequestId>
</KMS>