All Products
Search
Document Center

Key Management Service:Key management types and key specifications

Last Updated:Jul 22, 2026

In scenarios such as data encryption and digital signatures, you can select an appropriate key management type and key specification based on compliance requirements (such as national cryptography compliance), performance needs, or security levels. After you purchase the national cryptography software module, software-protected keys support the Aliyun_SM4 specification. This topic describes the key specifications supported by each key management type.

Supported symmetric key specifications

Symmetric key encryption uses the same key for both encryption and decryption. KMS securely stores the key material to prevent unauthorized access, ensuring the confidentiality of your encrypted data.

Key specifications

The following table lists the key specifications supported by each key management type for symmetric keys.

Note
  • When you call the CreateKey operation to create a key without specifying KeySpec, KMS creates a symmetric key with the Aliyun_AES_256 specification by default.

  • HMAC keys require KMS instance version 4.1.0 or later. Otherwise, the console prompts you to upgrade the instance image. HMAC keys do not support automatic key rotation.

Key management type

Key specification

Supported encryption algorithm

Supported key usage

Padding mode

Default key

Aliyun_AES_256

GCM (default)

ENCRYPT/DECRYPT

N/A

Software-protected key

Aliyun_AES_256

GCM (default)

ENCRYPT/DECRYPT

N/A

HMAC_224

HMAC_SHA_224

SIGN/VERIFY

N/A

HMAC_256

HMAC_SHA_256

SIGN/VERIFY

HMAC_384

HMAC_SHA_384

SIGN/VERIFY

HMAC_512

HMAC_SHA_512

SIGN/VERIFY

Hardware-protected key

  • Aliyun_AES_256

  • Aliyun_AES_192

  • Aliyun_AES_128

GCM (default), ECB, CBC

ENCRYPT/DECRYPT

  • When the encryption mode is GCM: no padding mode is involved.

  • When the encryption mode is ECB/CBC: the padding mode is PKCS7_PADDING or NO_PADDING.

HMAC_224

HMAC_SHA_224

SIGN/VERIFY

N/A

HMAC_256

HMAC_SHA_256

SIGN/VERIFY

HMAC_384

HMAC_SHA_384

SIGN/VERIFY

HMAC_512

HMAC_SHA_512

SIGN/VERIFY

External key

Aliyun_AES_256

GCM (default), ECB, CBC

ENCRYPT/DECRYPT

  • When the encryption mode is GCM: no padding mode is involved.

  • When the encryption mode is ECB/CBC: the padding mode is PKCS7_PADDING or NO_PADDING.

Technical standards

Supported asymmetric key specifications

An asymmetric key consists of a cryptographically related public key and private key pair. The public key can be freely distributed, while the private key must remain securely protected and accessible only to the owner or trusted parties.

Note

For asymmetric keys created in KMS, the public key can be obtained through the GetPublicKey operation or the KMS console. KMS ensures the security of private keys and does not provide any operation to export them.

Asymmetric keys are typically used for digital signature verification or for encrypting and distributing small amounts of data such as symmetric keys. Set the key usage when you create an asymmetric key.

  • ENCRYPT/DECRYPT: Use the public key to encrypt data through the Encrypt operation, and the private key to decrypt data through the Decrypt operation.

  • SIGN/VERIFY: Use the private key to compute digital signatures through the Sign operation, and the public key to verify signatures through the Verify operation.

Note

Due to the high computational cost of asymmetric cryptographic operations, use asymmetric keys only for small data blocks such as securely distributing symmetric keys.

Key specifications

The following table lists the key specifications supported by each key management type for asymmetric keys.

Key management type

Key specification

Supported encryption algorithm

Supported signature algorithm

Software-protected key

RSA_2048, RSA_3072, RSA_4096

RSAES_OAEP_SHA_256 (default)

RSA_PSS_SHA_256 (default), RSA_PKCS1_SHA_256

EC_P256, EC_P256K

ECIES_DH_SHA_1_XOR_HMAC (default)

ECDSA_SHA_256 (default)

Ed25519

Not supported

EdDSA

Hardware-protected key

RSA_2048, RSA_3072, RSA_4096

RSAES_OAEP_SHA_256 (default)

RSA_PSS_SHA_256 (default), RSA_PKCS1_SHA_256

EC_P256, EC_P256K

ECIES_DH_SHA_1_XOR_HMAC (default)

ECDSA_SHA_256 (default)

Technical standards

Encryption algorithms

  • RSAES_OAEP_SHA_256: RSA encryption using the RSAES-OAEP mode as defined in RFC 3447/PKCS#1, with MGF1 and SHA-256.

  • ECIES_DH_SHA_1_XOR_HMAC: Complies with the SEC 1: Elliptic Curve Cryptography, Version 2.0 standard. Uses ECDH for key agreement, KDF2 with SHA-1 for key derivation, HMAC-SHA-1 as the MAC algorithm, and XOR for symmetric encryption.

Signature algorithms

  • RSA_PSS_SHA_256: Computes the SHA-256 hash of the data and the signature using the RSASSA-PSS algorithm as defined in RFC 3447/PKCS#1, with MGF1 (SHA-256).

  • RSA_PKCS1_SHA_256: Computes the SHA-256 hash of the data and the signature using the RSASSA-PKCS1-v1_5 algorithm as defined in RFC 3447/PKCS#1.

  • ECDSA_SHA_256: ECDSA digital signature using the SHA-256 hash algorithm.