Decrypts the ciphertext that is specified by the CiphertextBlob parameter.

You can call this operation to decrypt the ciphertext that is generated by using the following operations:

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.

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

A JSON string that consists of key-value pairs. If you specify this parameter when you encrypt the data or data key, an equivalent value is required here. For more information, see EncryptionContext.

Response parameters

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

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

This parameter is the globally unique ID 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 decrypted plaintext.

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

The ID of the request.

Examples

Sample requests

http(s)://[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.