ListKeyDetail

Last updated: 2020-03-20 19:00:13

1. API Description

Domain name for API request: kms.tencentcloudapi.com.

Get the master key list details according to the specified Offset and Limit.

A maximum of 100 requests can be initiated per second for this API.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: ListKeyDetail.
Version Yes String Common parameter. The value used for this API: 2019-01-18.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
Offset No Integer
Limit No Integer This parameter has the same meaning of the Limit in an SQL query, indicating that up to Limit value elements can be obtained in this request. The default value is 10 and the maximum value is 200.
Role No Integer
OrderType No Integer
KeyState No Integer Filters by CMK status. 0: all CMKs; 1: CMKs in Enabled status only; 2: CMKs in Disabled status only; 3: CMKs in PendingDelete status only (i.e., keys with schedule deletion enabled); 4: CMKs in PendingImport status only.
SearchKeyAlias No String
Origin No String Filters by CMK type. "TENCENT_KMS" indicates to filter CMKs whose key materials are created by KMS; "EXTERNAL" indicates to filter CMKs of EXTERNAL type whose key materials are imported by users; "ALL" or empty indicates to filter CMKs of both types. This value is case-sensitive.
KeyUsage No String Filter by KeyUsage of CMKs. If this parameter is left empty, it means to filter all CMKs. Valid values: ENCRYPT_DECRYPT, ASYMMETRIC_DECRYPT_RSA_2048, ASYMMETRIC_DECRYPT_SM2

3. Output Parameters

Parameter Name Type Description
TotalCount Integer
KeyMetadatas Array of KeyMetadata List of returned attribute information.
Note: this field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Get master key list details

Input Example

https://kms.tencentcloudapi.com/?Action=ListKeyDetail
&Offset=0
&Limit=3
&Role=0
&<common request parameters>

Output Example

{
  "Response": {
    "RequestId": "1b580852-1e38-11e9-b129-5cb9019b4b00",
    "KeyMetadatas": [
      {
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b01",
        "Alias": "myalias",
        "CreateTime": 1548210729,
        "Description": "test cmk",
        "KeyState": "Enabled",
        "KeyUsage": "ENCRYPT_DECRYPT",
        "Type": 1,
        "CreatorUin": 1001,
        "KeyRotationEnabled": true,
        "Owner": "user",
        "NextRotateTime": 1553151489,
        "DeletionDate": 0,
        "Origin": "TENCENT_KMS",
        "ValidTo": 0
      },
      {
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b02",
        "Alias": "testalias",
        "CreateTime": 1548210730,
        "Description": "test cmk",
        "KeyState": "Disabled",
        "KeyUsage": "ENCRYPT_DECRYPT",
        "Type": 1,
        "CreatorUin": 1001,
        "KeyRotationEnabled": true,
        "Owner": "user",
        "NextRotateTime": 1553151489,
        "DeletionDate": 0,
        "Origin": "TENCENT_KMS",
        "ValidTo": 0
      },
      {
        "KeyId": "23e80852-1e38-11e9-b129-5cb9019b4b03",
        "Alias": "testalias2",
        "CreateTime": 1548210730,
        "Description": "test cmk",
        "KeyState": "PendingDelete",
        "KeyUsage": "ENCRYPT_DECRYPT",
        "Type": 1,
        "CreatorUin": 1001,
        "KeyRotationEnabled": true,
        "Owner": "user",
        "NextRotateTime": 1553151489,
        "DeletionDate": 1560580015,
        "Origin": "TENCENT_KMS",
        "ValidTo": 0
      }
    ],
    "TotalCount": 100
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InvalidParameter Invalid parameter.
UnauthorizedOperation Unauthorized operation.