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
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| KeyId | string | Yes | 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
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 code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is not valid. | An invalid value is specified for the parameter. |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The error message returned because the specified CMK does not exist. |
| 404 | Forbidden.AliasNotFound | The specified Alias is not found. | The error message returned because the specified alias does not exist. |
| 404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. | - |
For a list of error codes, visit the Service error codes.
