Skip to main content

List

Returns the list of asymmetric KMS keys in the specified folder.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListAsymmetricEncryptionKeysRequest =
cloudApi.kms.asymmetricencryption_asymmetric_encryption_key_service
.ListAsymmetricEncryptionKeysRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(
serviceClients.AsymmetricEncryptionKeyServiceClient
);

const result = await client.list(
ListAsymmetricEncryptionKeysRequest.fromPartial({
folderId: "folderId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListAsymmetricEncryptionKeysRequest

folderId : string

ID of the folder to list asymmetric KMS keys in.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListAsymmetricEncryptionKeysResponse.next_page_token that can be used to get the next page of results in subsequent list requests. Default value: 100.

pageToken : string

Page token. To get the next page of results, set page_token to the ListAsymmetricEncryptionKeysResponse.next_page_token returned by a previous list request.

ListAsymmetricEncryptionKeysResponse

keys : AsymmetricEncryptionKey

List of asymmetric KMS keys in the specified folder.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is greater than the specified ListAsymmetricEncryptionKeysRequest.page_size, use the next_page_token as the value for the ListAsymmetricEncryptionKeysRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

AsymmetricEncryptionKey

An asymmetric KMS key that may contain several versions of the cryptographic material.

Status
  • STATUS_UNSPECIFIED

  • CREATING

    The key is being created.

  • ACTIVE

    The key is active and can be used for encryption and decryption or signature and verification. Can be set to INACTIVE using the [AsymmetricKeyService.Update][9] method.

  • INACTIVE

    The key is inactive and unusable. Can be set to ACTIVE using the [AsymmetricKeyService.Update][10] method.

id : string

ID of the key.

folderId : string

ID of the folder that the key belongs to.

createdAt : google.protobuf.Timestamp

Time when the key was created.

name : string

Name of the key.

description : string

Description of the key.

labels : string

Custom labels for the key as key:value pairs. Maximum 64 per key.

status : Status

Current status of the key.

encryptionAlgorithm : AsymmetricEncryptionAlgorithm

Asymmetric Encryption Algorithm ID.

deletionProtection : bool

Flag that inhibits deletion of the key