# PublicKeyProps

Properties for creating a Public Key.

Extends: PublicKeyProps
Used as props by: PublicKey

- Source: [`aws-cloudfront/lib/public-key.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cloudfront/lib/public-key.ts#L24)

## Example

```ts
// Create a key group to use with CloudFront signed URLs and signed cookies.
new cloudfront.KeyGroup(this, 'MyKeyGroup', {
  items: [
    new cloudfront.PublicKey(this, 'MyPublicKey', {
      encodedKey: '...', // contents of public_key.pem file
      // comment: 'Key is expiring on ...',
    }),
  ],
  // comment: 'Key group containing public keys ...',
});
```

## Properties

- `comment`: string — A comment to describe the public key.

  **Default:** no comment

- `encodedKey`: string (required) — The public key that you can use with signed URLs and signed cookies, or with field-level encryption.

  The `encodedKey` parameter must include `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----` lines.

- `publicKeyName`: string — A name to identify the public key.

  **Default:** generated from the `id`
