Decrypts the ciphertext that is specified by the CiphertextBlob parameter.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes Decrypt

The operation that you want to perform. Set the value to Decrypt.

CiphertextBlob String Yes DZhOWVmZDktM2QxNi00ODk0LWJkNGYtMWZjNDNmM2YyYWJmaaSl+TztSIMe43nbTH/Z1Wr4XfLftKhAciUmDQXuMRl4WTvKhxjMThjK****

The ciphertext that you want to decrypt.

You can generate the ciphertext by calling the following operations:

EncryptionContext Json No {"Example":"Example"}

The JSON string that consists of key-value pairs.

Note If you specify the EncryptionContext parameter when you call the GenerateDataKey, Encrypt, or GenerateDataKeyWithoutPlaintext operation, you must specify the same context when you call the Decrypt operation. For more information, see EncryptionContext.

Response parameters

Parameter Type Example Description
KeyId String 202b9877-5a25-46e3-a763-e20791b5****

The ID of the customer master key (CMK) that is used to decrypt the ciphertext.

It is the GUID of the CMK.

KeyVersionId String 2ab1a983-7072-4bbc-a582-584b5bd8****

The ID of the CMK version that is used to decrypt the ciphertext.

Plaintext String tRYXuCwgja12xxO1N/gZERDDCLw9doZEQiPDk/Bv****

The plaintext that is generated after decryption.

RequestId String 207596a2-36d3-4840-b1bd-f87044699bd7

The ID of the request.

Examples

Sample requests

https://[Endpoint]/?Action=Decrypt
&CiphertextBlob=DZhOWVmZDktM2QxNi00ODk0LWJkNGYtMWZjNDNmM2YyYWJmaaSl+TztSIMe43nbTH/Z1Wr4XfLftKhAciUmDQXuMRl4WTvKhxjMThjK****
&<Common request parameters>

Sample success responses

XML format

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

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.