GetCertificate - AWS Certificate Manager

GetCertificate

Retrieves a certificate and its certificate chain. The certificate may be either a public or private certificate issued using the ACM RequestCertificate action, or a certificate imported into ACM using the ImportCertificate action. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use OpenSSL to decode the certificates and inspect individual fields.

Request Syntax

{ "CertificateArn": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

CertificateArn

String that contains a certificate ARN in the following format:

arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012

For more information about ARNs, see Amazon Resource Names (ARNs).

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:[\w+=/,.@-]+:acm:[\w+=/,.@-]*:[0-9]+:[\w+=,.@-]+(/[\w+=,.@-]+)*

Required: Yes

Response Syntax

{ "Certificate": "string", "CertificateChain": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Certificate

The ACM-issued certificate corresponding to the ARN specified as input.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 32768.

Pattern: -{5}BEGIN CERTIFICATE-{5}\u000D?\u000A([A-Za-z0-9/+]{64}\u000D?\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\u000D?\u000A-{5}END CERTIFICATE-{5}(\u000D?\u000A)?

CertificateChain

Certificates forming the requested certificate's chain of trust. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 2097152.

Pattern: (-{5}BEGIN CERTIFICATE-{5}\u000D?\u000A([A-Za-z0-9/+]{64}\u000D?\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\u000D?\u000A-{5}END CERTIFICATE-{5}\u000D?\u000A)*-{5}BEGIN CERTIFICATE-{5}\u000D?\u000A([A-Za-z0-9/+]{64}\u000D?\u000A)*[A-Za-z0-9/+]{1,64}={0,2}\u000D?\u000A-{5}END CERTIFICATE-{5}(\u000D?\u000A)?

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidArnException

The requested Amazon Resource Name (ARN) does not refer to an existing resource.

HTTP Status Code: 400

RequestInProgressException

The certificate request is in process and the certificate in your account has not yet been issued.

HTTP Status Code: 400

ResourceNotFoundException

The specified certificate cannot be found in the caller's account or the caller's account cannot be found.

HTTP Status Code: 400

Examples

Get an ACM Certificate

This example illustrates one usage of GetCertificate.

Sample Request

POST / HTTP/1.1 Host: acm.us-east-1.amazonaws.com X-Amz-Target: CertificateManager.GetCertificate X-Amz-Date: 20151221T210018Z User-Agent: aws-cli/1.9.7 Python/2.7.3 Linux/3.13.0-71-generic botocore/1.3.7 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20151221/us-east-1/acm/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=b51b4c2d5518473a8552fdab8e313c76254e9ca64e4d8ab69c2ebef83dbd459b { "CertificateArn": "arn:aws:acm:us-east-1:111122223333:certificate/12345678-1234-1234-1234-123456789012" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: d5300b5a-a825-11e5-9141-fbb8a078e3eb Content-Type: application/x-amz-json-1.1 Content-Length: 6506 Date: Mon, 21 Dec 2015 21:00:15 GMT { "Certificate": "-----BEGIN CERTIFICATE-----Base64-encoded-----END CERTIFICATE-----", "CertificateChain": "-----BEGIN CERTIFICATE-----Base64-encoded-----END CERTIFICATE-----" "-----BEGIN CERTIFICATE-----Base64-encoded-----END CERTIFICATE-----" "-----BEGIN CERTIFICATE-----Base64-encoded-----END CERTIFICATE-----" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: