Skip to content

PublicKey

Source: src/AWS/CloudFront/PublicKey.ts

A CloudFront public key.

Public keys are uploaded ahead of being grouped into a {@link KeyGroup} and used by Distributions for signed URL or signed cookie verification.

The key body is immutable after creation — changing encodedKey triggers a replacement (CloudFront returns no API to rotate a key in place).

const key = yield* PublicKey("SignedUrlKey", {
encodedKey: Redacted.make(yield* fs.readFileString("./public_key.pem")),
comment: "RSA-2048 signed URL key for /private",
});