Learn R Programming

paws.security.identity (version 0.1.0)

kms_decrypt: Decrypts ciphertext

Description

Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted by using any of the following operations:

Usage

kms_decrypt(CiphertextBlob, EncryptionContext, GrantTokens)

Arguments

CiphertextBlob

[required] Ciphertext to be decrypted. The blob includes metadata.

EncryptionContext

The encryption context. If this was specified in the Encrypt function, it must be specified here or the decryption operation will fail. For more information, see Encryption Context.

GrantTokens

A list of grant tokens.

For more information, see Grant Tokens in the AWS Key Management Service Developer Guide.

Request syntax

svc$decrypt(
  CiphertextBlob = raw,
  EncryptionContext = list(
    "string"
  ),
  GrantTokens = list(
    "string"
  )
)

Details

  • GenerateDataKey

  • GenerateDataKeyWithoutPlaintext

  • Encrypt

Note that if a caller has been granted access permissions to all keys (through, for example, IAM user policies that grant Decrypt permission on all resources), then ciphertext encrypted by using keys in other accounts where the key grants access to the caller can be decrypted. To remedy this, we recommend that you do not grant Decrypt access in an IAM user policy. Instead grant Decrypt access only in key policies. If you must grant Decrypt access in an IAM user policy, you should scope the resource to specific keys or to specific trusted accounts.

The result of this operation varies with the key state of the CMK. For details, see How Key State Affects Use of a Customer Master Key in the AWS Key Management Service Developer Guide.

Examples

Run this code
# NOT RUN {
# The following example decrypts data that was encrypted with a customer
# master key (CMK) in AWS KMS.
# }
# NOT RUN {
svc$decrypt(
  CiphertextBlob = "<binary data>"
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab