Security

An application must migrate KMS ciphertext to a different symmetric KMS key without exposing plaintext to application code, while preserving its encryption context. The role has kms:ReEncryptFrom on the source and kms:ReEncryptTo on the destination. What should the developer do?

Show the answer

Correct answerB. Call ReEncrypt with the destination key and matching source and destination contexts.

AWhy not this: An alias change affects future key selection but does not change the key protecting existing ciphertext.

BWhy this is right: ReEncrypt keeps plaintext inside KMS and supports the stated source and destination permissions and encryption contexts.

CWhy not this: Decrypt returns plaintext to the caller and requires kms:Decrypt, which the stated permissions do not provide.

DWhy not this: GenerateDataKey creates a new data key; it does not migrate existing KMS ciphertext.

ReEncrypt changes the protecting KMS key within AWS KMS without returning plaintext to the application. Supplying the original context for both source and destination preserves it. Decrypt followed by Encrypt exposes plaintext and requires different permissions.