Decrypts ciphertext.
Operation description
Precautions
-
For details about the access policies that Resource Access Management (RAM) users or RAM roles need to invoke this API operation, see Access control.
-
This operation can be invoked through a shared gateway or a dedicated gateway. For more information, see Alibaba Cloud SDK.
Shared gateway: Access KMS through public network access or a VPC endpoint. This method requires you to enable the public network switch. For more information, see Access keys in a KMS instance over the Internet.
Dedicated gateway: Access KMS through a KMS private endpoint (
<YOUR_KMS_INSTANCE_ID>.cryptoservice.kms.aliyuncs.com).
QPS limits
Calls through a shared gateway: The QPS limit for a single user is 1,000 calls per second. If the limit is exceeded, API calls are throttled, which may affect your business. Call this operation at a reasonable rate.
Calls through a dedicated gateway: The QPS limit for a single user is based on the performance specifications of your KMS instance. For more information, see Performance data.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kms:Decrypt |
get |
*Key
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CiphertextBlob |
string |
Yes |
The ciphertext to decrypt. The ciphertext can be generated by the following API operations: |
DZhOWVmZDktM2QxNi00ODk0LWJkNGYtMWZjNDNmM2YyYWJmaaSl+TztSIMe43nbTH/Z1Wr4XfLftKhAciUmDQXuMRl4WTvKhxjMThjK**** |
| EncryptionContext |
object |
No |
A JSON string of key/value pairs. Note
If you specified EncryptionContext when calling GenerateDataKey, Encrypt, or GenerateDataKeyWithoutPlaintext to encrypt data, you must provide the same parameter when decrypting. For more information, see EncryptionContext. |
{"Example":"Example"} |
| DryRun |
string |
No |
Specifies whether to enable DryRun mode. Valid values:
DryRun mode is used to test API calls, verify whether you have the required permissions on the relevant resources, and check whether the request parameters are configured correctly. When DryRun mode is enabled, KMS always returns a failure with a reason. The failure reasons include the following:
|
false |
| Recipient |
string |
No |
{ "AttestationDocument":"base64-encoded-attestion-document", "KeyEncryptionAlgorithm":"RSAES_OAEP_SHA_256" } |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| KeyVersionId |
string |
The identifier of the key version under the customer master key (CMK) that was used to decrypt the ciphertext. |
2ab1a983-7072-4bbc-a582-584b5bd8**** |
| KeyId |
string |
The ID of the CMK used to decrypt the ciphertext. |
202b9877-5a25-46e3-a763-e20791b5**** |
| RequestId |
string |
The request ID. This is a unique identifier generated by Alibaba Cloud for the request. You can use it to troubleshoot and locate issues. |
207596a2-36d3-4840-b1bd-f87044699bd7 |
| Plaintext |
string |
The decrypted plaintext. |
tRYXuCwgja12xxO1N/gZERDDCLw9doZEQiPDk/Bv**** |
| CiphertextForRecipient |
string |
NIahY6pgjK4ZMP2R0EmsmBqntrv0AI2rcDyU7Su6uOT9Le7EOvlCpjHJfr9z3M0vkfulQoyuETmKSpYDfixE3auE4MwxloT6D9Gfsk6hm5FV2iAxL//Ms2kLv6K4z6yGi7lKm2yjX4***== |
Examples
Success response
JSON format
{
"KeyVersionId": "2ab1a983-7072-4bbc-a582-584b5bd8****",
"KeyId": "202b9877-5a25-46e3-a763-e20791b5****",
"RequestId": "207596a2-36d3-4840-b1bd-f87044699bd7",
"Plaintext": "tRYXuCwgja12xxO1N/gZERDDCLw9doZEQiPDk/Bv****",
"CiphertextForRecipient": "NIahY6pgjK4ZMP2R0EmsmBqntrv0AI2rcDyU7Su6uOT9Le7EOvlCpjHJfr9z3M0vkfulQoyuETmKSpYDfixE3auE4MwxloT6D9Gfsk6hm5FV2iAxL//Ms2kLv6K4z6yGi7lKm2yjX4***==\n"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | UnsupportedOperation | This action is not supported. | The operation is not supported. |
| 404 | Forbidden.AliasNotFound | The specified Alias is not found. | The error message returned because the specified alias does not exist. |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The error message returned because the specified CMK does not exist. |
| 409 | Rejected.Disabled | The request was rejected because the key state is Disabled. | The request was rejected because the key state is Disabled. |
| 409 | Rejected.PendingDeletion | The request was rejected because the key state is PendingDeletion. | The request was rejected because the key state is PendingDeletion. |
| 409 | Rejected.Unavailable | The request was rejected because the key state is Unavailable. | The request was denied because the key status is unavailable. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.