Get
Returns the specified asymmetric KMS key.
To get the list of available asymmetric KMS keys, make a SymmetricKeyService.List request.
- TypeScript
- Python
import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";
const GetAsymmetricEncryptionKeyRequest =
cloudApi.kms.asymmetricencryption_asymmetric_encryption_key_service
.GetAsymmetricEncryptionKeyRequest;
(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(
serviceClients.AsymmetricEncryptionKeyServiceClient
);
const result = await client.get(
GetAsymmetricEncryptionKeyRequest.fromPartial({
keyId: "keyId",
})
);
console.log(result);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.kms.v1.asymmetricencryption.asymmetric_encryption_key_service_pb2_grpc import (
AsymmetricEncryptionKeyServiceStub,
)
from yandex.cloud.kms.v1.asymmetricencryption.asymmetric_encryption_key_service_pb2 import (
GetAsymmetricEncryptionKeyRequest,
)
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(AsymmetricEncryptionKeyServiceStub)
response = service.Get(GetAsymmetricEncryptionKeyRequest(key_id="keyId"))
print(response)
GetAsymmetricEncryptionKeyRequest
keyId
: string
ID of the asymmetric KMS key to return. To get the ID of an asymmetric KMS key use a AsymmetricEncryptionKeyService.List request.
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][3] method.
INACTIVE
The key is inactive and unusable. Can be set to ACTIVE using the [AsymmetricKeyService.Update][4] 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