Skip to main content

Get

Returns chain and private key of the specified certificate.

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

const GetCertificateContentRequest =
cloudApi.certificatemanager.certificate_content_service
.GetCertificateContentRequest;
const PrivateKeyFormat =
cloudApi.certificatemanager.certificate_content_service.PrivateKeyFormat;

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

const result = await client.get(
GetCertificateContentRequest.fromPartial({
// certificateId: "certificateId",
// versionId: "versionId",
// privateKeyFormat: PrivateKeyFormat.PKCS1
})
);
console.log(result);
})();

GetCertificateContentRequest

certificateId : string

ID of the certificate to download content.

versionId : string

Optional ID of the version.

privateKeyFormat : PrivateKeyFormat

Desired format of private key

GetCertificateContentResponse

certificateId : string

ID of the certificate.

certificateChain : string

PEM-encoded certificate chain content of the certificate.

privateKey : string

PEM-encoded private key content of the certificate.