Viewing keys

Last updated: 2023-08-24 17:29:34

Overview

API
API Description
Note
ListKeys
List the key information (KeyId) under the account
This API operation has no required parameters. For more information, see the ListKeys interface.
DescribeKey
View the detailed information of a specified Customer Master Key (CMK), including the CMK name, ID, status, region, and other key details.
The KeyId for this API operation is a required parameter. For more details, please refer to the DescribeKey interface.
This example uses Tencent Cloud's Command Line Tool TCCLI. You can use any supported programming language for subsequent calls.

Sample

Viewing Key ID List Example

This example describes how to view the information of the first five KeyIds in Guangzhou region.

Input

tccli kms ListKeys --region ap-guangzhou --Limit 5

Output

{
"Keys": [
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09"
},
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09"
},
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09"
},
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09"
},
{
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09"
}
],
"TotalCount": 114,
"RequestId": "afaaeb5e-c97d-4726-8012-6ae337d62928"
}

Viewing Key ID Details Example

This example describes how to view the details of the specified CMK.

Input

tccli kms DescribeKey --region ap-guangzhou --KeyId 521xxxxx-xxxx-xxxx-xxxx-52xxxxd4

Output

If the API is successfully executed, the details of the CMK will be returned.
{
"KeyMetadata": {
"KeyId": "6xxxxxxx-xxxx-xxxx-xxxx-5xxxxxxxxc09",
"Description": "this is test for gz key",
"CreatorUin": 10xxxxxxxxxx,
"KeyRotationEnabled": false,
"NextRotateTime": 1603439621,
"CreateTime": 1571903621,
"Alias": "test-gz01",
"KeyUsage": "ENCRYPT_DECRYPT",
"DeletionDate": 0,
"KeyState": "Enabled",
"Type": 4,
"Owner": "user"
},
"RequestId": "608f514c-3279-44ea-8e4c-c00b69e3521c"
}