# KeyUsage

The key usage, represents the cryptographic operations of keys.

- Source: [`aws-kms/lib/key.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-kms/lib/key.ts#L415)
- Type last changed: v2.167.0 · 13 Nov 2024

## Example

```ts
const key = new kms.Key(this, 'MyKey', {
  keySpec: kms.KeySpec.ECC_SECG_P256K1, // Default to SYMMETRIC_DEFAULT
  keyUsage: kms.KeyUsage.SIGN_VERIFY,    // and ENCRYPT_DECRYPT
});
```

## Members

| Member | Description |
| --- | --- |
| `ENCRYPT_DECRYPT` | Encryption and decryption. |
| `SIGN_VERIFY` | Signing and verification. |
| `GENERATE_VERIFY_MAC` | Generating and verifying MACs. |
| `KEY_AGREEMENT` | Deriving shared secrets. |

## Referenced by

- [`KeyProps`](/v2/docs/aws-cdk-lib.aws_kms.KeyProps).keyUsage
