# KeyAttributesProperty

The role of the key, the algorithm it supports, and the cryptographic operations allowed with the key.

This data is immutable after the key is created.

- Source: Generated at build time
- Type last changed: v2.140.0 · 2 May 2024

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_paymentcryptography as paymentcryptography } from 'aws-cdk-lib';
const keyAttributesProperty: paymentcryptography.CfnKey.KeyAttributesProperty = {
  keyAlgorithm: 'keyAlgorithm',
  keyClass: 'keyClass',
  keyModesOfUse: {
    decrypt: false,
    deriveKey: false,
    encrypt: false,
    generate: false,
    noRestrictions: false,
    sign: false,
    unwrap: false,
    verify: false,
    wrap: false,
  },
  keyUsage: 'keyUsage',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_paymentcryptography as paymentcryptography

key_attributes_property = paymentcryptography.CfnKey.KeyAttributesProperty(
    key_algorithm="keyAlgorithm",
    key_class="keyClass",
    key_modes_of_use=paymentcryptography.CfnKey.KeyModesOfUseProperty(
        decrypt=False,
        derive_key=False,
        encrypt=False,
        generate=False,
        no_restrictions=False,
        sign=False,
        unwrap=False,
        verify=False,
        wrap=False
    ),
    key_usage="keyUsage"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.paymentcryptography.*;

KeyAttributesProperty keyAttributesProperty = KeyAttributesProperty.builder()
        .keyAlgorithm("keyAlgorithm")
        .keyClass("keyClass")
        .keyModesOfUse(KeyModesOfUseProperty.builder()
                .decrypt(false)
                .deriveKey(false)
                .encrypt(false)
                .generate(false)
                .noRestrictions(false)
                .sign(false)
                .unwrap(false)
                .verify(false)
                .wrap(false)
                .build())
        .keyUsage("keyUsage")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.PaymentCryptography;

var keyAttributesProperty = new KeyAttributesProperty {
    KeyAlgorithm = "keyAlgorithm",
    KeyClass = "keyClass",
    KeyModesOfUse = new KeyModesOfUseProperty {
        Decrypt = false,
        DeriveKey = false,
        Encrypt = false,
        Generate = false,
        NoRestrictions = false,
        Sign = false,
        Unwrap = false,
        Verify = false,
        Wrap = false
    },
    KeyUsage = "keyUsage"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

keyAttributesProperty := &KeyAttributesProperty{
	KeyAlgorithm: jsii.String("keyAlgorithm"),
	KeyClass: jsii.String("keyClass"),
	KeyModesOfUse: &KeyModesOfUseProperty{
		Decrypt: jsii.Boolean(false),
		DeriveKey: jsii.Boolean(false),
		Encrypt: jsii.Boolean(false),
		Generate: jsii.Boolean(false),
		NoRestrictions: jsii.Boolean(false),
		Sign: jsii.Boolean(false),
		Unwrap: jsii.Boolean(false),
		Verify: jsii.Boolean(false),
		Wrap: jsii.Boolean(false),
	},
	KeyUsage: jsii.String("keyUsage"),
}
```

## Properties

- `keyAlgorithm`: string (required) — The key algorithm to be use during creation of an AWS Payment Cryptography key.

  For symmetric keys, AWS Payment Cryptography supports `AES` and `TDES` algorithms. For asymmetric keys, AWS Payment Cryptography supports `RSA` and `ECC_NIST` algorithms.

- `keyClass`: string (required) — The type of AWS Payment Cryptography key to create, which determines the classiﬁcation of the cryptographic method and whether AWS Payment Cryptography key contains a symmetric key or an asymmetric key pair.

- `keyModesOfUse`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnKey.KeyModesOfUseProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_paymentcryptography.CfnKey.KeyModesOfUseProperty.html) (required) — The list of cryptographic operations that you can perform using the key.

- `keyUsage`: string (required) — The cryptographic usage of an AWS Payment Cryptography key as deﬁned in section A.5.2 of the TR-31 spec.
