Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DVA-C03

Encryption, keys, and certificates

DVA-C03 · Lesson 12 of 24 · 1:37:53

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DVA-C03 exam (AWS Certified Developer – Associate). In this lesson: encryption at rest and in transit, S3 server-side encryption (SSE-S3, SSE-KMS, DSSE-KMS, SSE-C), client-side encryption, KMS keys, key policies, rotation, envelope encryption with data keys, ACM and private certificates, and EC2 key pairs. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Questions from the auditors

The auditors of AnyCompany Tickets ask three questions: is customer data encrypted at rest, is it encrypted in transit, and who controls the keys? The developers must answer with settings and code, not promises. This lesson covers encryption at rest and in transit, server-side and client-side encryption, AWS KMS and envelope encryption, and certificates and key pairs.

At rest and in transit

Encryption in transit protects data on the network, with TLS: AWS service endpoints support HTTPS, and a bucket policy can refuse requests that do not use it. Encryption at rest protects stored data, and most services do it with keys from AWS KMS. S3 encrypts every new object by default, since January 2023, and DynamoDB encrypts every table at rest. So the real choices are about which key, who controls it, and where the encryption happens.

Server-side and client-side

With server-side encryption, the service encrypts the data when it stores it, and decrypts it when an allowed caller reads it. In S3, SSE-S3, with keys managed by S3, is the default. SSE-KMS uses a KMS key, so a key policy controls who can decrypt, and CloudTrail logs every use of the key, while DSSE-KMS adds a second layer. SSE-C uses a key that the client sends with each request, and S3 does not store it. With client-side encryption, the application encrypts the data before it leaves, so AWS only ever stores ciphertext.

KMS keys and envelope encryption

A KMS key never leaves AWS KMS unencrypted, and its key policy is the main control over who can use it. The Encrypt operation takes at most 4,096 bytes, so larger data uses envelope encryption. GenerateDataKey returns a data key twice: in plaintext, to encrypt the data locally, and encrypted under the KMS key, to store next to the data. The code discards the plaintext key, and later calls Decrypt on the stored key to read the data again. With automatic rotation, KMS creates new key material every year by default, and old ciphertext still decrypts.

Certificates and key pairs

AWS Certificate Manager provides public TLS certificates for load balancers, CloudFront, and API Gateway custom domains, and renews them for you. For CloudFront, the certificate must be in the US East, North Virginia Region. Since June 2025, new public certificates can also be exported, for servers outside these services. AWS Private CA issues private certificates for internal services, and a self-signed certificate only fits local development and tests, since no browser trusts it. And an EC2 key pair is for SSH: AWS stores the public key, and you keep the private key.

Answering the auditors

So, the answers for the auditors. In transit: TLS everywhere, with certificates from ACM, and HTTPS required by the bucket policies. At rest: SSE-KMS with customer managed keys for exports and tickets, and default encryption elsewhere. And the keys: key policies decide who decrypts, CloudTrail logs every use, and rotation runs every year.

Recap

Let's recap. TLS protects data in transit, and services like S3 and DynamoDB encrypt data at rest by default. SSE-S3 is the default in S3, SSE-KMS adds key policies and CloudTrail logging, SSE-C uses the client's key, and client-side encryption leaves only ciphertext. KMS keys stay in KMS, Encrypt takes up to 4,096 bytes, and envelope encryption uses data keys for the rest. Rotation creates new key material every year by default. And ACM renews public certificates, Private CA issues internal ones, and key pairs open SSH access.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. The finance team wants the sales exports in S3 encrypted with a key whose use is logged in CloudTrail, and only the reporting role may decrypt them. What should the developer configure?

    • SSE-S3, the default encryption of the bucket
    • SSE-KMS with a customer managed KMS key
    • TLS for every request made to the bucket
    • SSE-C with a key from the application
    Show the answer

    SSE-KMS with a customer managed KMS key

    SSE-KMS with a customer managed key lets the key policy name who may decrypt, and every use of the key appears in CloudTrail. “SSE-S3, the default encryption of the bucket” would encrypt the data, but with keys that S3 manages, and no key policy to set. “TLS for every request made to the bucket” would only protect the data on the network. And “SSE-C with a key from the application” would make the application send its own key with every request, and manage that key itself.

  2. A function must encrypt seating plans of about two megabytes with a KMS key, and the call to Encrypt fails because the data is too large. What should the developer do?

    • Split each plan into chunks of 4 KB
    • Export the KMS key to encrypt locally
    • Turn on automatic rotation of the key
    • Use GenerateDataKey and encrypt locally
    Show the answer

    Use GenerateDataKey and encrypt locally

    GenerateDataKey gives a data key to encrypt the plan locally, and its encrypted copy is stored next to the plan. “Split each plan into chunks of 4 KB” would only make smaller pieces, with hundreds of calls, for no gain over a data key. “Export the KMS key to encrypt locally” would not help, since KMS keys never leave KMS. And “Turn on automatic rotation of the key” would only change how the key is rotated, and Encrypt would still refuse the data.

  3. A CloudFront distribution needs a custom domain name, with a certificate from ACM. The team requested the certificate in the Paris Region, and CloudFront cannot select it. What should the developer do?

    • Copy the certificate to the US East Region
    • Issue a private certificate from Private CA
    • Request the certificate in US East (N. Virginia)
    • Use a self-signed certificate for the domain
    Show the answer

    Request the certificate in US East (N. Virginia)

    CloudFront only uses ACM certificates from the US East, North Virginia Region, so the team requests it there. “Copy the certificate to the US East Region” would not work, since a certificate cannot be copied between Regions. “Issue a private certificate from Private CA” would issue a private certificate, which browsers do not trust. And “Use a self-signed certificate for the domain” would only fit a test, since no browser trusts a self-signed certificate.