ReEncrypt
Source:
src/AWS/KMS/ReEncrypt.ts
Runtime binding for kms:ReEncrypt.
Re-encrypts a ciphertext under a new key (or a new encryption context)
entirely inside KMS — the plaintext never leaves the service. Bind the
destination KMS Key (or alias/... name), and optionally the
source key when migrating ciphertexts between keys:
ReEncrypt(key)— same-key re-encryption (e.g. rotating the encryption context). Grantskms:ReEncryptFrom+kms:ReEncryptToon the key.ReEncrypt(destination, source)— cross-key migration. Grantskms:ReEncryptToon the destination andkms:ReEncryptFromon the source, and pinsSourceKeyIdin every request.
Re-Encryption
Section titled “Re-Encryption”Rotate the Encryption Context In Place
const reEncrypt = yield* AWS.KMS.ReEncrypt(key);
const { CiphertextBlob } = yield* reEncrypt({ CiphertextBlob: ciphertext, SourceEncryptionContext: { tenant: "alpha" }, DestinationEncryptionContext: { tenant: "beta" },});Migrate Ciphertexts to a New Key
const reEncrypt = yield* AWS.KMS.ReEncrypt(newKey, oldKey);
const { CiphertextBlob } = yield* reEncrypt({ CiphertextBlob: legacyCiphertext,});