All Products
Search
Document Center

Key Management Service:DescribeKey

Last Updated:Jul 29, 2025

Queries the information about a key.

Operation description

You can query the information about the CMK 05754286-3ba2-4fa6-8d41-4323aca6**** by using parameter settings provided in this topic. The information includes the creator, creation time, status, and deletion protection status of the CMK.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
KeyIdstringYes

The ID of the CMK. The ID must be globally unique.

You can also set this parameter to an alias that is bound to the CMK. For more information, see Overview of aliases.

05754286-3ba2-4fa6-8d41-4323aca6****

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

f1fdfa9d-bd49-418b-942f-8f3e3ec00a4f
KeyMetadataobject

The metadata of the CMK.

DeletionProtectionstring

Indicates whether deletion protection is enabled. Valid values:

  • Enabled
  • Disabled
Enabled
KeyIdstring

The ID of the CMK. The ID must be globally unique.

05754286-3ba2-4fa6-8d41-4323aca6****
NextRotationDatestring

The time when the next rotation will be performed.

Note This parameter is returned only when the value of the AutomaticRotation parameter is Enabled or Suspended.
2021-07-06T18:22:03Z
KeyStatestring

The status of the CMK.

For more information, see Impact of CMK status on API operations.

Enabled
RotationIntervalstring

The interval for automatic key rotation.

Unit: seconds.

For example, if the value is 604800s, automatic key rotation is performed at a 7-day interval.

Note This parameter is returned only when the value of the AutomaticRotation parameter is Enabled or Suspended.
31536000s
Arnstring

The Alibaba Cloud Resource Name (ARN) of the CMK.

acs:kms:cn-hangzhou:154035569884****:key/05754286-3ba2-4fa6-8d41-4323aca6****
Creatorstring

The Alibaba Cloud account that is used to create the CMK.

154035569884****
LastRotationDatestring

The time when the last rotation was performed. The time is displayed in UTC. For a new CMK, the value of this parameter is the time when the initial version of the CMK was generated.

2021-05-20T06:34:21Z
DeleteDatestring

The time at which the CMK is scheduled for deletion. The time is displayed in UTC.

For more information, see ScheduleKeyDeletion .

Note This parameter is returned only when the value of the KeyState parameter is PendingDeletion.
2021-05-26T18:22:03Z
PrimaryKeyVersionstring

The ID of the current primary key version for the symmetric CMK.

515e0b0a-624f-45ab-92b5-54f9b551****
Descriptionstring

The description of the CMK.

key description example
KeySpecstring

The type of the CMK.

Aliyun_AES_256
Originstring

The source of the key material for the CMK.

Aliyun_KMS
MaterialExpireTimestring

The time when the key material expires. The time is displayed in UTC. If this parameter value is empty, the key material does not expire.

2021-07-06T18:22:03Z
DeletionProtectionDescriptionstring

The description of deletion protection.

The CMK is being used by XXX. Deletion protection is set.
AutomaticRotationstring

Indicates whether automatic key rotation is enabled. Valid values:

  • Enabled
  • Disabled
  • Suspended

For more information, see Automatic key rotation.

Note Only symmetric CMKs support automatic key rotation.
Disabled
ProtectionLevelstring

The protection level of the CMK.

HSM
KeyUsagestring

The usage of the CMK.

ENCRYPT/DECRYPT
CreationDatestring

The time when the CMK was created. The time is displayed in UTC.

2021-05-20T06:34:21Z
DKMSInstanceIdstring

The ID of the dedicated KMS instance.

kst-bjj62d8f5e0sgtx8h****

Examples

Sample success responses

JSONformat

{
  "RequestId": "f1fdfa9d-bd49-418b-942f-8f3e3ec00a4f",
  "KeyMetadata": {
    "DeletionProtection": "Enabled",
    "KeyId": "05754286-3ba2-4fa6-8d41-4323aca6****",
    "NextRotationDate": "2021-07-06T18:22:03Z",
    "KeyState": "Enabled",
    "RotationInterval": "31536000s",
    "Arn": "acs:kms:cn-hangzhou:154035569884****:key/05754286-3ba2-4fa6-8d41-4323aca6****",
    "Creator": "154035569884****",
    "LastRotationDate": "2021-05-20T06:34:21Z",
    "DeleteDate": "2021-05-26T18:22:03Z",
    "PrimaryKeyVersion": "515e0b0a-624f-45ab-92b5-54f9b551****",
    "Description": "key description example",
    "KeySpec": "Aliyun_AES_256",
    "Origin": "Aliyun_KMS",
    "MaterialExpireTime": "2021-07-06T18:22:03Z",
    "DeletionProtectionDescription": "The CMK is being used by XXX. Deletion protection is set.",
    "AutomaticRotation": "Disabled",
    "ProtectionLevel": "HSM",
    "KeyUsage": "ENCRYPT/DECRYPT",
    "CreationDate": "2021-05-20T06:34:21Z",
    "DKMSInstanceId": "kst-bjj62d8f5e0sgtx8h****"
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe specified parameter is not valid.An invalid value is specified for the parameter.
404Forbidden.KeyNotFoundThe specified Key is not found.The error message returned because the specified CMK does not exist.
404Forbidden.AliasNotFoundThe specified Alias is not found.The error message returned because the specified alias does not exist.
404InvalidAccessKeyId.NotFoundThe Access Key ID provided does not exist in our records.-

For a list of error codes, visit the Service error codes.