A developer is building a high-throughput microservice that must encrypt data payloads (each approximately in size) locally before storing them in an database. To implement envelope encryption efficiently and minimize network latency, the service needs to obtain a new symmetric key that contains both a plaintext version for immediate encryption and an encrypted version for storage alongside the data. Which AWS KMS API operation should the service call to receive both versions in a single request?
- GenerateDataKeyAnswer
- BGenerateDataKeyWithoutPlaintext
- CEncrypt
- DGenerateRandom
Answer
GenerateDataKey
The GenerateDataKey operation is designed for envelope encryption. It generates a unique data key and returns both a plaintext copy and an encrypted copy in a single response, matching the requirement to minimize network latency.
Step-by-Step Solution
Key Concept
AWS KMS Envelope Encryption Key Generation