CfnKeyPropsMixin
- class aws_cdk.mixins_preview.aws_paymentcryptography.mixins.CfnKeyPropsMixin(props, *, strategy=None)
Bases:
MixinCreates 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
CreateKeyoperation 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_KEYandTR31_K1_KEY_BLOCK_PROTECTION_KEY. When creating ECC key pairs in AWS Payment Cryptography you can optionally set theDeriveKeyUsageparameter, 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:
- 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:
- 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
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
KeyAttributesProperty
- class CfnKeyPropsMixin.KeyAttributesProperty(*, key_algorithm=None, key_class=None, key_modes_of_use=None, key_usage=None)
Bases:
objectThe 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 supportsAESandTDESalgorithms. For asymmetric keys, AWS Payment Cryptography supportsRSAandECC_NISTalgorithms.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:
- 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
AESandTDESalgorithms. For asymmetric keys, AWS Payment Cryptography supportsRSAandECC_NISTalgorithms.
- 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.
- key_modes_of_use
The list of cryptographic operations that you can perform using the key.
- key_usage
The cryptographic usage of an AWS Payment Cryptography key as defined in section A.5.2 of the TR-31 spec.
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:
objectThe 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: - falsederive_key (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key can be used to derive new keys. Default: - falseencrypt (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key can be used to encrypt data. Default: - falsegenerate (
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: - falseno_restrictions (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key has no special restrictions other than the restrictions implied byKeyUsage. Default: - falsesign (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key can be used for signing. Default: - falseunwrap (
Union[bool,IResolvable,None]) – Default: - falseverify (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key can be used to verify signatures. Default: - falsewrap (
Union[bool,IResolvable,None]) – Specifies whether an AWS Payment Cryptography key can be used to wrap other keys. Default: - false
- See:
- 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.
- derive_key
Specifies whether an AWS Payment Cryptography key can be used to derive new keys.
- encrypt
Specifies whether an AWS Payment Cryptography key can be used to encrypt data.
- generate
Specifies whether an AWS Payment Cryptography key can be used to generate and verify other card and PIN verification keys.
- no_restrictions
Specifies whether an AWS Payment Cryptography key has no special restrictions other than the restrictions implied by
KeyUsage.
- sign
Specifies whether an AWS Payment Cryptography key can be used for signing.
- unwrap
false
- verify
Specifies whether an AWS Payment Cryptography key can be used to verify signatures.
- wrap
Specifies whether an AWS Payment Cryptography key can be used to wrap other keys.