CfnKeyPropsMixin

class aws_cdk.mixins_preview.aws_paymentcryptography.mixins.CfnKeyPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates an AWS Payment Cryptography key, a logical representation of a cryptographic key, that is unique in your account and AWS Region .

You use keys for cryptographic functions such as encryption and decryption.

In addition to the key material used in cryptographic operations, an AWS Payment Cryptography key includes metadata such as the key ARN, key usage, key origin, creation date, description, and key state.

When you create a key, you specify both immutable and mutable data about the key. The immutable data contains key attributes that define the scope and cryptographic operations that you can perform using the key, for example key class (example: SYMMETRIC_KEY ), key algorithm (example: TDES_2KEY ), key usage (example: TR31_P0_PIN_ENCRYPTION_KEY ) and key modes of use (example: Encrypt ). AWS Payment Cryptography binds key attributes to keys using key blocks when you store or export them. AWS Payment Cryptography stores the key contents wrapped and never stores or transmits them in the clear.

For information about valid combinations of key attributes, see Understanding key attributes in the AWS Payment Cryptography User Guide . The mutable data contained within a key includes usage timestamp and key deletion timestamp and can be modified after creation.

You can use the CreateKey operation to generate an ECC (Elliptic Curve Cryptography) key pair used for establishing an ECDH (Elliptic Curve Diffie-Hellman) key agreement between two parties. In the ECDH key agreement process, both parties generate their own ECC key pair with key usage K3 and exchange the public keys. Each party then use their private key, the received public key from the other party, and the key derivation parameters including key derivation function, hash algorithm, derivation data, and key algorithm to derive a shared key.

To maintain the single-use principle of cryptographic keys in payments, ECDH derived keys should not be used for multiple purposes, such as a TR31_P0_PIN_ENCRYPTION_KEY and TR31_K1_KEY_BLOCK_PROTECTION_KEY . When creating ECC key pairs in AWS Payment Cryptography you can optionally set the DeriveKeyUsage parameter, which defines the key usage bound to the symmetric key that will be derived using the ECC key pair.

Cross-account use : This operation can’t be used across different AWS accounts.

Related operations:

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-paymentcryptography-key.html

CloudformationResource:

AWS::PaymentCryptography::Key

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

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

cfn_key_props_mixin = paymentcryptography_mixins.CfnKeyPropsMixin(paymentcryptography_mixins.CfnKeyMixinProps(
    derive_key_usage="deriveKeyUsage",
    enabled=False,
    exportable=False,
    key_attributes=paymentcryptography_mixins.CfnKeyPropsMixin.KeyAttributesProperty(
        key_algorithm="keyAlgorithm",
        key_class="keyClass",
        key_modes_of_use=paymentcryptography_mixins.CfnKeyPropsMixin.KeyModesOfUseProperty(
            decrypt=False,
            derive_key=False,
            encrypt=False,
            generate=False,
            no_restrictions=False,
            sign=False,
            unwrap=False,
            verify=False,
            wrap=False
        ),
        key_usage="keyUsage"
    ),
    key_check_value_algorithm="keyCheckValueAlgorithm",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::PaymentCryptography::Key.

Parameters:
  • props (Union[CfnKeyMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['deriveKeyUsage', 'enabled', 'exportable', 'keyAttributes', 'keyCheckValueAlgorithm', 'tags']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

KeyAttributesProperty

class CfnKeyPropsMixin.KeyAttributesProperty(*, key_algorithm=None, key_class=None, key_modes_of_use=None, key_usage=None)

Bases: object

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.

Parameters:
  • key_algorithm (Optional[str]) – 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.

  • key_class (Optional[str]) – The type of AWS Payment Cryptography key to create, which determines the classification of the cryptographic method and whether AWS Payment Cryptography key contains a symmetric key or an asymmetric key pair.

  • key_modes_of_use (Union[IResolvable, KeyModesOfUseProperty, Dict[str, Any], None]) – The list of cryptographic operations that you can perform using the key.

  • key_usage (Optional[str]) – The cryptographic usage of an AWS Payment Cryptography key as defined in section A.5.2 of the TR-31 spec.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keyattributes.html

ExampleMetadata:

fixture=_generated

Example:

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

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

Attributes

key_algorithm

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.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keyattributes.html#cfn-paymentcryptography-key-keyattributes-keyalgorithm

key_class

The type of AWS Payment Cryptography key to create, which determines the classification of the cryptographic method and whether AWS Payment Cryptography key contains a symmetric key or an asymmetric key pair.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keyattributes.html#cfn-paymentcryptography-key-keyattributes-keyclass

key_modes_of_use

The list of cryptographic operations that you can perform using the key.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keyattributes.html#cfn-paymentcryptography-key-keyattributes-keymodesofuse

key_usage

The cryptographic usage of an AWS Payment Cryptography key as defined in section A.5.2 of the TR-31 spec.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keyattributes.html#cfn-paymentcryptography-key-keyattributes-keyusage

KeyModesOfUseProperty

class CfnKeyPropsMixin.KeyModesOfUseProperty(*, decrypt=None, derive_key=None, encrypt=None, generate=None, no_restrictions=None, sign=None, unwrap=None, verify=None, wrap=None)

Bases: object

The list of cryptographic operations that you can perform using the key.

The modes of use are defined in section A.5.3 of the TR-31 spec.

Parameters:
  • decrypt (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to decrypt data. Default: - false

  • derive_key (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to derive new keys. Default: - false

  • encrypt (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to encrypt data. Default: - false

  • generate (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to generate and verify other card and PIN verification keys. Default: - false

  • no_restrictions (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key has no special restrictions other than the restrictions implied by KeyUsage . Default: - false

  • sign (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used for signing. Default: - false

  • unwrap (Union[bool, IResolvable, None]) – Default: - false

  • verify (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to verify signatures. Default: - false

  • wrap (Union[bool, IResolvable, None]) – Specifies whether an AWS Payment Cryptography key can be used to wrap other keys. Default: - false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html

ExampleMetadata:

fixture=_generated

Example:

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

key_modes_of_use_property = paymentcryptography_mixins.CfnKeyPropsMixin.KeyModesOfUseProperty(
    decrypt=False,
    derive_key=False,
    encrypt=False,
    generate=False,
    no_restrictions=False,
    sign=False,
    unwrap=False,
    verify=False,
    wrap=False
)

Attributes

decrypt

Specifies whether an AWS Payment Cryptography key can be used to decrypt data.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-decrypt

derive_key

Specifies whether an AWS Payment Cryptography key can be used to derive new keys.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-derivekey

encrypt

Specifies whether an AWS Payment Cryptography key can be used to encrypt data.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-encrypt

generate

Specifies whether an AWS Payment Cryptography key can be used to generate and verify other card and PIN verification keys.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-generate

no_restrictions

Specifies whether an AWS Payment Cryptography key has no special restrictions other than the restrictions implied by KeyUsage .

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-norestrictions

sign

Specifies whether an AWS Payment Cryptography key can be used for signing.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-sign

unwrap
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-unwrap

Type:

default

verify

Specifies whether an AWS Payment Cryptography key can be used to verify signatures.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-verify

wrap

Specifies whether an AWS Payment Cryptography key can be used to wrap other keys.

Default:
  • false

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-paymentcryptography-key-keymodesofuse.html#cfn-paymentcryptography-key-keymodesofuse-wrap