SignHash
Signs hash value specified KMS key.
- TypeScript
- Python
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);
})();
import os
import grpc
import yandexcloud
from yandex.cloud.kms.v1.asymmetricsignature.asymmetric_signature_crypto_service_pb2 import (
AsymmetricSignHashRequest,
)
from yandex.cloud.kms.v1.asymmetricsignature.asymmetric_signature_crypto_service_pb2_grpc import (
AsymmetricSignatureCryptoServiceStub,
)
token = os.getenv("YC_OAUTH_TOKEN")
sdk = yandexcloud.SDK(token=token)
service = sdk.client(AsymmetricSignatureCryptoServiceStub)
response = service.SignHash(AsymmetricSignHashRequest(key_id="keyId", hash=b""))
print(response)
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.