Skip to main content

SignHash

Signs hash value specified KMS key.

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

const AsymmetricSignHashRequest =
cloudApi.kms.asymmetricsignature_asymmetric_signature_crypto_service
.AsymmetricSignHashRequest;

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

const result = await client.signHash(
AsymmetricSignHashRequest.fromPartial({
keyId: "keyId",
hash: Buffer.from([]),
})
);
console.log(result);
})();

AsymmetricSignHashRequest

keyId : string

ID of the asymmetric KMS key to use for signature.

hash : bytes

Hash value to be signed. Should be encoded with base64.

AsymmetricSignHashResponse

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.