All Products
Search
Document Center

Key Management Service:DescribeKeyVersion

Last Updated:Jun 14, 2024

Queries the information about a key version.

In the following example, a key whose ID is key-hzz630494463ejqjx**** is queried.The version ID of the key is 2ab1a983-7072-4bbc-a582-584b5bd8****. The returned result shows that the creation time of the key version is 2024-03-25T10:42:40Z.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes DescribeKeyVersion

The operation that you want to perform. Set the value to DescribeKeyVersion.

KeyId String Yes key-hzz630494463ejqjx****

The ID, alias, or Alibaba Cloud Resource Name (ARN) of the key. For more information, see Manage a key alias.

Note When you access a key within another Alibaba Cloud account, you must enter the ARN of the key. The key ARN is in the acs:kms:${region}:${account}:key/${keyid} format.
KeyVersionId String Yes 2ab1a983-7072-4bbc-a582-584b5bd8****

The ID of the key version. The ID must be globally unique.

You can call the ListKeyVersions operation to query the versions of the key.

For more information about common request parameters, see Common parameters.

Response parameters

Parameter

Type

Example

Description

RequestId String 7021b6ec-4be7-4d3c-8a68-1e85d4d515a0

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

KeyVersion Object

The metadata of the key version.

KeyId String key-hzz630494463ejqjx****

The ID of the key. If KeyId is set to the alias or ARN of the key, the ID of the key is returned.

KeyVersionId String 2ab1a983-7072-4bbc-a582-584b5bd8****

The ID of the key version. The ID must be globally unique.

CreationDate String 2024-03-25T10:42:40Z

The date and time when the key version is created. The time is displayed in UTC.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeKeyVersion
&KeyId=key-hzz630494463ejqjx****
&KeyVersionId=2ab1a983-7072-4bbc-a582-584b5bd8****
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeKeyVersionResponse>
    <RequestId>7021b6ec-4be7-4d3c-8a68-1e85d4d515a0</RequestId>
    <KeyVersion>
        <KeyId>key-hzz630494463ejqjx****</KeyId>
        <KeyVersionId>2ab1a983-7072-4bbc-a582-584b5bd8****</KeyVersionId>
        <CreationDate>2024-03-25T10:42:40Z</CreationDate>
    </KeyVersion>
</DescribeKeyVersionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "7021b6ec-4be7-4d3c-8a68-1e85d4d515a0",
  "KeyVersion" : {
    "KeyId" : "key-hzz630494463ejqjx****",
    "KeyVersionId" : "2ab1a983-7072-4bbc-a582-584b5bd8****",
    "CreationDate" : "2024-03-25T10:42:40Z"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is not valid. The specified parameter is invalid.

For a list of error codes, see Service error codes.