Skip to content
v2.277.0

KeySpec Enum ​

The key spec, represents the cryptographic configuration of keys.

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
});
python
key = kms.Key(self, "MyKey",
    key_spec=kms.KeySpec.ECC_SECG_P256K1,  # Default to SYMMETRIC_DEFAULT
    key_usage=kms.KeyUsage.SIGN_VERIFY
)
java
Key key = Key.Builder.create(this, "MyKey")
        .keySpec(KeySpec.ECC_SECG_P256K1) // Default to SYMMETRIC_DEFAULT
        .keyUsage(KeyUsage.SIGN_VERIFY)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var key = new Key(this, "MyKey", new KeyProps {
    KeySpec = KeySpec.ECC_SECG_P256K1,  // Default to SYMMETRIC_DEFAULT
    KeyUsage = KeyUsage.SIGN_VERIFY
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
key := kms.NewKey(this, jsii.String("MyKey"), &KeyProps{
	KeySpec: kms.KeySpec_ECC_SECG_P256K1,
	 // Default to SYMMETRIC_DEFAULT
	KeyUsage: kms.KeyUsage_SIGN_VERIFY,
})

Members ​

MemberDescription
SYMMETRIC_DEFAULTThe default key spec.
RSA_2048RSA with 2048 bits of key.
RSA_3072RSA with 3072 bits of key.
RSA_4096RSA with 4096 bits of key.
ECC_NIST_P256NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and SHA-256 for the message digest.
ECC_NIST_P384NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and SHA-384 for the message digest.
ECC_NIST_P521NIST FIPS 186-4, Section 6.4, ECDSA signature using the curve specified by the key and SHA-512 for the message digest.
ECC_SECG_P256K1Standards for Efficient Cryptography 2, Section 2.4.1, ECDSA signature on the Koblitz curve.
HMAC_224Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA224.
HMAC_256Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA256.
HMAC_384Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA384.
HMAC_512Hash-Based Message Authentication Code as defined in RFC 2104 using the message digest function SHA512.
SM2Elliptic curve key spec available only in China Regions.
ML_DSA_44ML-DSA-44 lattice-based digital signature algorithm.
ML_DSA_65ML-DSA-65 lattice-based digital signature algorithm.
ML_DSA_87ML-DSA-87 lattice-based digital signature algorithm.
ECC_NIST_EDWARDS25519NIST-standard Edwards25519 (ed25519) elliptic curve key pair.

Referenced by ​

  • KeyProps.keySpeckey_speckeySpecKeySpecKeySpec