A backend service must encrypt large archives of user data locally before uploading them to a third-party storage provider. The developer needs to implement envelope encryption using a customer managed key in AWS KMS. The service needs to obtain a data key that can be used to encrypt the archives immediately and then be discarded from memory.
Which AWS KMS API operation should the developer invoke to retrieve the required data key?
- AEncrypt
- GenerateDataKeyAnswer
- CGenerateDataKeyWithoutPlaintext
- DDecrypt
Answer
GenerateDataKey
The correct answer is the operation GenerateDataKey. In envelope encryption, the application needs to encrypt data locally. It calls the GenerateDataKey API, which returns a plaintext data key and an encrypted data key. The application uses the plaintext data key to encrypt the data, discards the plaintext key from memory, and stores the encrypted data key alongside the encrypted data.
Step-by-Step Solution
Key Concept
KMS Envelope Encryption API operations
Estimated Time:1m 30s