All Products
Search
Document Center

Key Management Service:GetCertificate

Last Updated:Jul 29, 2025

Queries a certificate that is managed by Certificates Manager.

Operation description

In this example, the certificate whose ID is 9a28de48-8d8b-484d-a766-dec4**** is queried. The certificate, certificate chain, certificate ID, and certificate signing request (CSR) are returned.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
CertificateIdstringYes

The ID of the certificate. It is the globally unique identifier (GUID) of the certificate in Certificates Manager.

9a28de48-8d8b-484d-a766-dec4****

For more information about common request parameters, see Common parameters.

Response parameters

ParameterTypeDescriptionExample
object
CertificateChainstring

The certificate chain in the PEM format.

-----BEGIN CERTIFICATE----- (Sub CA Certificate PEM Content) -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- (Sub CA Certificate PEM Content) -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- (Root CA Certificate PEM Content) -----END CERTIFICATE-----
Certificatestring

The certificate in the Privacy Enhanced Mail (PEM) format.

-----BEGIN CERTIFICATE----- (X.509 Certificate PEM Content) -----END CERTIFICATE-----
RequestIdstring

The ID of the request.

b3e104b4-0319-4a20-ab7f-9fef6****
CertificateIdstring

The ID of the certificate.

9a28de48-8d8b-484d-a766-dec4****
Csrstring

The CSR in the PEM format.

-----BEGIN CERTIFICATE REQUEST-----MIICxjCCAa4CAQAwPzELMAkGA1UEBhMCQ04xDzANBgNVBAoTBmFsaXl1bjEMMAoGA1UECxMDa21zMREwDwY****-----END CERTIFICATE REQUEST-----

Examples

Sample success responses

JSONformat

{
  "CertificateChain": "-----BEGIN CERTIFICATE-----  (Sub CA Certificate PEM Content)  -----END CERTIFICATE-----  -----BEGIN CERTIFICATE-----  (Sub CA Certificate PEM Content)  -----END CERTIFICATE-----  -----BEGIN CERTIFICATE-----  (Root CA Certificate PEM Content)  -----END CERTIFICATE-----",
  "Certificate": "-----BEGIN CERTIFICATE-----  (X.509 Certificate PEM Content)  -----END CERTIFICATE-----",
  "RequestId": "b3e104b4-0319-4a20-ab7f-9fef6****",
  "CertificateId": "9a28de48-8d8b-484d-a766-dec4****",
  "Csr": "-----BEGIN CERTIFICATE REQUEST-----MIICxjCCAa4CAQAwPzELMAkGA1UEBhMCQ04xDzANBgNVBAoTBmFsaXl1bjEMMAoGA1UECxMDa21zMREwDwY****-----END CERTIFICATE REQUEST-----"
}

Error codes

HTTP status codeError codeError messageDescription
404InvalidAccessKeyId.NotFoundThe specified AccessKey ID does not exist.The AccessKey ID is not found.

For a list of error codes, visit the Service error codes.