Skip to content
v2.278.0

CfnKeyProps Struct ​

Properties for defining a CfnKey.

Example ​

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 cfnKeyProps: paymentcryptography.CfnKeyProps = {
  exportable: false,
  keyAttributes: {
    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',
  },

  // the properties below are optional
  deriveKeyUsage: 'deriveKeyUsage',
  enabled: false,
  keyCheckValueAlgorithm: 'keyCheckValueAlgorithm',
  policy: 'policy',
  replicationRegions: ['replicationRegions'],
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# 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

cfn_key_props = paymentcryptography.CfnKeyProps(
    exportable=False,
    key_attributes=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"
    ),

    # the properties below are optional
    derive_key_usage="deriveKeyUsage",
    enabled=False,
    key_check_value_algorithm="keyCheckValueAlgorithm",
    policy="policy",
    replication_regions=["replicationRegions"],
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
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.*;

CfnKeyProps cfnKeyProps = CfnKeyProps.builder()
        .exportable(false)
        .keyAttributes(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())

        // the properties below are optional
        .deriveKeyUsage("deriveKeyUsage")
        .enabled(false)
        .keyCheckValueAlgorithm("keyCheckValueAlgorithm")
        .policy("policy")
        .replicationRegions(List.of("replicationRegions"))
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
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 cfnKeyProps = new CfnKeyProps {
    Exportable = false,
    KeyAttributes = 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"
    },

    // the properties below are optional
    DeriveKeyUsage = "deriveKeyUsage",
    Enabled = false,
    KeyCheckValueAlgorithm = "keyCheckValueAlgorithm",
    Policy = "policy",
    ReplicationRegions = new [] { "replicationRegions" },
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
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"

cfnKeyProps := &CfnKeyProps{
	Exportable: jsii.Boolean(false),
	KeyAttributes: &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"),
	},

	// the properties below are optional
	DeriveKeyUsage: jsii.String("deriveKeyUsage"),
	Enabled: jsii.Boolean(false),
	KeyCheckValueAlgorithm: jsii.String("keyCheckValueAlgorithm"),
	Policy: jsii.String("policy"),
	ReplicationRegions: []*string{
		jsii.String("replicationRegions"),
	},
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

deriveKeyUsageoptionalstringderive_key_usageoptionalstrderiveKeyUsageoptionalStringDeriveKeyUsageoptionalstringDeriveKeyUsageoptional*string #
The cryptographic usage of an ECDH derived key as defined in section A.5.2 of the TR-31 spec.
enabledoptionalboolean | IResolvableenabledoptionaltyping.Union[bool, IResolvable]enabledoptionalBooleanEnabledoptionalboolEnabledoptionalinterface{} #
Specifies whether the key is enabled.
exportableboolean | IResolvableexportabletyping.Union[bool, IResolvable]exportableBooleanExportableboolExportableinterface{} required #
Specifies whether the key is exportable.

This data is immutable after the key is created.

keyAttributesIResolvable | CfnKey.KeyAttributesPropertykey_attributestyping.Union[IResolvable, KeyAttributesProperty]keyAttributesIResolvableKeyAttributesIResolvableKeyAttributesinterface{} required #
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.

keyCheckValueAlgorithmoptionalstringkey_check_value_algorithmoptionalstrkeyCheckValueAlgorithmoptionalStringKeyCheckValueAlgorithmoptionalstringKeyCheckValueAlgorithmoptional*string #
The algorithm that AWS Payment Cryptography uses to calculate the key check value (KCV).
notes

It is used to validate the key integrity.

For TDES keys, the KCV is computed by encrypting 8 bytes, each with value of zero, with the key to be checked and retaining the 3 highest order bytes of the encrypted result. For AES keys, the KCV is computed using a CMAC algorithm where the input data is 16 bytes of zero and retaining the 3 highest order bytes of the encrypted result.

policyoptionalstringpolicyoptionalstrpolicyoptionalStringPolicyoptionalstringPolicyoptional*string #
The resource-based policy attached to the key, in JSON format.
replicationRegionsoptionalstring[]replication_regionsoptionaltyping.List[str]replicationRegionsoptionalList<String>ReplicationRegionsoptionalstring[]ReplicationRegionsoptional*[]*string #
The list of AWS Regions to remove from the key's replication configuration.

The key will no longer be available for cryptographic operations in these regions after removal. Ensure no active operations depend on the key in these regions before removal.

tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #