tencent cloud

APIs

ListKeyDetail

Download
フォーカスモード
フォントサイズ
最終更新日: 2026-08-28 10:41:24

1. API Description

Domain name for API request: kms.intl.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.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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 Params. The value used for this API: ListKeyDetail.
Version Yes String Common Params. The value used for this API: 2019-01-18.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
Offset No Integer

It means the same as the Offset in SQL queries, indicating that this retrieval starts from the Offset-th element of the sequentially arranged array. It defaults to 0.

Limit No Integer

The meaning is consistent with the Limit in SQL queries, indicating that this time up to Limit elements can be retrieved. The default value is 10, and the maximum value is 200.

Role No Integer

Filter by creator role. Default value 0 indicates CMKs created by the user, and 1 indicates CMKs automatically created by authorized other Cloud services.

OrderType No Integer

Sort by CMK creation time. 0 indicates sort in descending order, and 1 indicates sort in ascending order.

KeyState No Integer

Filter by CMK status. 0 indicates all CMKs, 1 indicates querying only Enabled CMKs, 2 indicates querying only Disabled CMKs, 3 indicates querying CMKs in PendingDelete state (keys in scheduled deletion status), 4 indicates querying CMKs in PendingImport state, and 5 indicates querying CMKs in Archived state.

SearchKeyAlias No String

Perform a fuzzy match query by KeyId or Alias

Origin No String

Filter by CMK type. "TENCENT_KMS" means to filter CMKs whose key material is created by KMS. "EXTERNAL" means to filter EXTERNAL type CMKs whose key material needs user import. "ALL" or unset means to query both types. Case-sensitive.

KeyUsage No String

Filter by the KeyUsage of the CMK. ALL indicates filtering all. The parameters used can be: ALL, ENCRYPT_DECRYPT, ASYMMETRIC_DECRYPT_RSA_2048, ASYMMETRIC_DECRYPT_SM2, ASYMMETRIC_SIGN_VERIFY_SM2, ASYMMETRIC_SIGN_VERIFY_RSA_2048, or ASYMMETRIC_SIGN_VERIFY_ECC. If empty, it filters the ENCRYPT_DECRYPT type by default.

TagFilters.N No Array of TagFilter

Tag filtering condition

HsmClusterId No String

HSM Cluster ID corresponding to the KMS advanced edition (only applicable to KMS exclusive/managed service instances). When specifying a cluster ID, query the key list within the specified cluster. When specifying default, query the key list of the public cloud shared version. If empty, query all key lists by default, including cluster and non-cluster.

MemberAccounts.N No Array of MemberAccount

Array of member account information of the trusted service

3. Output Parameters

Parameter Name Type Description
TotalCount Integer

Total number of CMKs

KeyMetadatas Array of KeyMetadata

Returned attribute information list.

RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Get the Master Key List Details

Input Example

POST / HTTP/1.1
Host: kms.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: ListKeyDetail
<Common request parameters>

{
    "Offset": 0,
    "Limit": 10,
    "Role": 0,
    "OrderType": 0,
    "KeyState": 0,
    "SearchKeyAlias": "Weijiali",
    "Origin": "TENCENT_KMS",
    "KeyUsage": "ALL",
    "TagFilters": [
        {
            "TagKey": "env",
            "TagValue": [
                "dev"
            ]
        }
    ],
    "HsmClusterId": "cls-hsm-3dflmo9g"
}

Output Example

{
    "Response": {
        "KeyMetadatas": [
            {
                "Alias": "Weijiali_test_000000005",
                "CreateTime": 1725354067,
                "CreatorUin": 700001028674,
                "DeletionDate": 0,
                "Description": "weijiali_test_00000000000005",
                "HsmClusterId": "cls-hsm-3dflmo9g",
                "KeyId": "0ed49d3e-69d3-11ef-9841-52540089bc41",
                "KeyRotationEnabled": false,
                "KeyState": "Enabled",
                "KeyUsage": "ASYMMETRIC_SIGN_VERIFY_SM2",
                "NextRotateTime": 1756890067,
                "Origin": "TENCENT_KMS",
                "Owner": "user",
                "ResourceId": "creatorUin/700001028674/0ed49d3e-69d3-11ef-9841-52540089bc41",
                "Type": 4,
                "ValidTo": 0
            },
            {
                "Alias": "Weijiali_test_00000000000004",
                "CreateTime": 1725354055,
                "CreatorUin": 700001028674,
                "DeletionDate": 0,
                "Description": "Weijiali_test_00000000000004",
                "HsmClusterId": "cls-hsm-3dflmo9g",
                "KeyId": "07ad2031-69d3-11ef-9841-52540089bc41",
                "KeyRotationEnabled": false,
                "KeyState": "Enabled",
                "KeyUsage": "ASYMMETRIC_DECRYPT_SM2",
                "NextRotateTime": 1756890055,
                "Origin": "TENCENT_KMS",
                "Owner": "user",
                "ResourceId": "creatorUin/700001028674/07ad2031-69d3-11ef-9841-52540089bc41",
                "Type": 4,
                "ValidTo": 0
            },
            {
                "Alias": "weijiali_test_00000000000003",
                "CreateTime": 1725354040,
                "CreatorUin": 700001028674,
                "DeletionDate": 0,
                "Description": "weijiali_test_00000000000003",
                "HsmClusterId": "cls-hsm-3dflmo9g",
                "KeyId": "fea98175-69d2-11ef-910d-525400d834e5",
                "KeyRotationEnabled": false,
                "KeyState": "Enabled",
                "KeyUsage": "ENCRYPT_DECRYPT",
                "NextRotateTime": 1756890040,
                "Origin": "TENCENT_KMS",
                "Owner": "user",
                "ResourceId": "creatorUin/700001028674/fea98175-69d2-11ef-910d-525400d834e5",
                "Type": 4,
                "ValidTo": 0
            }
        ],
        "RequestId": "57c12411-dd1a-4f3c-aaff-aec49a442b6c",
        "TotalCount": 3
    }
}

5. Developer Resources

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.
InvalidParameterValue.InvalidHsmClusterId Invalid HSM cluster ID.
UnauthorizedOperation Unauthorized operation.
UnsupportedOperation.NotRoleOperation Unsupported operations for user roles.

ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック