Skip to main content

Sign

Signs data specified KMS key.

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

const AsymmetricSignRequest =
cloudApi.kms.asymmetricsignature_asymmetric_signature_crypto_service
.AsymmetricSignRequest;

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

const result = await client.sign(
AsymmetricSignRequest.fromPartial({
keyId: "keyId",
message: Buffer.from([]),
})
);
console.log(result);
})();

AsymmetricSignRequest

keyId : string

ID of the asymmetric KMS key to use for signature.

message : bytes

Message to sign. Should be encoded with base64.

AsymmetricSignResponse

keyId : string

ID of the asymmetric KMS key that was used for signature.

signature : bytes

Value of signature. Signature value is produced in accordance with RFC 8017 for RSA and is a DER-encoded object as defined by ANSI X9.62-2005 and RFC 3279 Section 2.2.3 for ECDSA.