All Products
Search
Document Center

Key Management Service:Understanding KMS keys

Last Updated:Mar 31, 2026

Keys are the core component of Key Management Service (KMS). KMS manages two key types—customer master keys (CMKs) and default keys—covering full lifecycle management, secure storage, data encryption, and digital signatures through cloud-native API calls.

Use cases

KMS keys serve two primary purposes:

  • Cryptographic operations in self-managed applications: Call the KMS OpenAPI or SDK to perform encryption, decryption, digital signing, and signature verification directly in your applications. For details, see Integrate KMS with self-managed applications.

  • Server-side encryption for Alibaba Cloud services: Integrate keys with KMS-supported services—such as Object Storage Service (OSS), Elastic Block Storage (EBS), and ApsaraDB RDS—to enable transparent encryption for data at rest. For details, see Overview of KMS integration for server-side encryption.

Key types

KMS provides two key types, distinguished by who manages the key and how much control you retain.

image
Key typeUse casesSub-typeAlgorithmManagement permissionsShareabilityCost
CMKUse in self-managed applications via API; server-side encryption with Alibaba Cloud servicesSoftware-protected key; hardware-protected key; external key (XKI)Symmetric and asymmetricFull lifecycle control: create, enable, disable, rotate, and deleteShareable across services and accountsPaid
Default keyServer-side encryption with Alibaba Cloud servicesService key; default CMKSymmetric onlyLimited: only some properties can be modified; creation is not supported. For details, see Key management feature comparison below.Limited to the current accountFree

CMK

CMKs are keys you create and fully control. Use them when you need custom cryptographic logic in your own applications, or when you need to bring your own key material and control rotation, deletion, and access policies.

CMKs support both symmetric keys and asymmetric keys. For details, see Key management types and key specifications.

CMK sub-types

Choose a CMK sub-type based on the protection level and key material ownership your use case requires.

CMK sub-typeWhen to useProtection methodKey material sourceBilling
Software-protected keyGeneral use cases that balance cost and securitySoftware-level: stored in a dedicated encrypted database within KMSKMS-generated (default), or imported via Bring Your Own Key (BYOK)Requires a software key management instance. Supports subscription and pay-as-you-go.
Hardware-protected keyHigh-compliance scenarios: finance, government, or workloads requiring GM/T or FIPS standardsHardware-level physical protection: the key is generated and used exclusively within a Hardware Security Module (HSM); plaintext key material never leaves the HSM. Key metadata is stored in the KMS database and managed through a dedicated hardware instance.KMS-generated (default), or imported via BYOKRequires a hardware key management instance and two HSM instances. Supports subscription and pay-as-you-go. For HSM pricing, see Cloud Hardware Security Module billing.
External key (XKI)Hybrid or multi-cloud deployments where you must retain key material in your own infrastructureYour external key manager (EKM) handles all key material and cryptographic operations; KMS stores only key metadata and proxies requests to your EKMYour EKM onlyRequires an external key management instance

Default keys

Default keys are automatically created by KMS or other Alibaba Cloud services. They are free and require no setup, making them the lowest-friction option for enabling server-side encryption in integrated cloud services.

Important
  • Default keys support server-side encryption for Alibaba Cloud services only. They do not support standalone cryptographic operations such as calling APIs for encryption and decryption.

  • Keys migrated from KMS 1.0 are in a read-only state and do not support any operations.

Default key sub-types

Default key sub-typeCreated byWhat you can doUniqueness
Default CMKCreated automatically in KMS 3.0Modify some properties; import external key material (BYOK) only when enabling the key for the first time; creation of new keys is not supportedOne per Alibaba Cloud account per region
Service keyCreated and used by a specific cloud service, such as OSS or ApsaraDB RDSKey properties cannot be modified; key rotation requires purchasing a value-added serviceOne per Alibaba Cloud account per cloud service per region

Default keys support symmetric keys only. For details, see Key management types and key specifications.

Choose a key type

Use the following to match your requirements to the right key type.

RequirementRecommended key type
Zero setup or costDefault key (service key or default CMK)
Full lifecycle control: rotation, deletion, and BYOKCMK (software-protected key)
Hardware-backed protection for compliance (GM/T, FIPS)CMK (hardware-protected key)
Key material must stay in your own infrastructureCMK (external key / XKI)
Call encryption/decryption APIs from your applicationCMK (any sub-type)
Asymmetric keys for signing and verificationCMK (software-protected or hardware-protected key)

Feature comparison

Integration and application support

Key typeSub-typeData encryption/decryption (self-managed apps)Signing/verification (self-managed apps)Server-side encryption for Alibaba Cloud services
Default keyDefault CMKNot supportedNot supportedSupported
Service keyNot supportedNot supportedSupported
CMKSoftware-protected keySupportedSupportedSupported
Hardware-protected keySupportedSupportedSupported
External key (XKI)SupportedNot supportedNot supported

For details, see Overview of KMS integration for server-side encryption. To call KMS from your own code, see Integrate KMS with self-managed applications and Alibaba Cloud SDKs.

Key management feature comparison

All key types support key identifier management (aliases and tags).

Key typeSub-typeKey rotationSchedule key deletionDeletion protectionImport external key material (BYOK)Backup management
Default keyDefault CMKSupported (requires a value-added service)SupportedSupportedNot supportedNot supported
Service keyNot supportedNot supportedNot supportedNot supportedNot supported
CMKSoftware-protected keySupported (symmetric keys only)SupportedSupportedSupportedSupported
Hardware-protected key

Not supported

SupportedSupportedSupportedNot supported
External key (XKI)Not supportedNot supportedNot supportedNot supportedNot supported

For operation details, see:

Security and performance

All key types support security auditing via ActionTrail. For performance data, see Performance metrics and Use ActionTrail to query management events for Key Management Service.

Key typeSub-typeSymmetric encryption/decryption performance
Default keyDefault CMK1,000 requests/second; upgrades not supported
Service key1,000 requests/second; upgrades not supported
CMKSoftware-protected keyShared gateway: 1,000 requests/second; upgrades not supported. Dedicated gateway: 1,000, 2,000, or 4,000 requests/second; upgrades supported.
Hardware-protected keyShared gateway: 1,000 requests/second; upgrades not supported. Dedicated gateway: 2,000, 4,000, 6,000, or 8,000 requests/second; upgrades supported.
External key (XKI)1,000 requests/second; upgrades not supported

FAQ

What is BYOK?

BYOK (Bring Your Own Key) is a feature that lets you generate key material outside of KMS and import it. BYOK is a feature, not a standalone key type. The following table shows which key types support it.

Key typeSub-typeBYOK supportDetails
CMKSoftware-protected keyYesImport key material after creating the key. See Import symmetric key material and Import asymmetric key material.
Hardware-protected keyYesSame import process as software-protected keys.
External key (XKI)NoKey material is managed entirely by your EKM; import into KMS is not supported.
Default keyDefault CMKYesImport is available only when enabling the key for the first time.
Service keyNoKey material is managed by the cloud service; import is not supported.

How do Alibaba Cloud key types correspond to AWS key types?

Alibaba CloudAmazon Web Services (AWS)
CMKCustomer managed keys
Service keyAWS managed keys

Appendix: Components of a key

A complete key has three parts: a key identifier, metadata, and key material.

Key identifier

A unique reference used in the console, an API, or a policy. KMS supports three identifier types:

  • ID: A unique string that serves as the primary identifier for the key.

  • Alibaba Cloud Resource Name (ARN): Includes the region ID, Alibaba Cloud account ID, and key ID. Format: acs:kms:<REGION_ID>:<ALIBABA_CLOUD_ACCOUNT_ID>:key/<KEY_ID>.

  • Key alias: A user-defined name that points to a specific key. Format: alias/<ALIAS_NAME>.

Metadata

Information describing the key's properties: ID, creation date, status (enabled or disabled), and purpose (encryption/decryption or signing/verification).

Key material

The binary data used for cryptographic operations. KMS supports two sources:

  • KMS-generated: KMS generates the key material internally.

  • External (BYOK): Generate the key material locally and import it into KMS.