AWS Certificate Manager
API Reference (API Version 2015-12-08)

ImportCertificate

Imports a certificate into AWS Certificate Manager (ACM) to use with services that are integrated with ACM. Note that integrated services allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see Importing Certificates in the AWS Certificate Manager User Guide.

Note

ACM does not provide managed renewal for certificates that you import.

Note the following guidelines when importing third party certificates:

  • You must enter the private key that matches the certificate you are importing.

  • The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.

  • If the certificate you are importing is not self-signed, you must enter its certificate chain.

  • If a certificate chain is included, the issuer must be the subject of one of the certificates in the chain.

  • The certificate, private key, and certificate chain must be PEM-encoded.

  • The current time must be between the Not Before and Not After certificate fields.

  • The Issuer field must not be empty.

  • The OCSP authority URL, if present, must not exceed 1000 characters.

  • To import a new certificate, omit the CertificateArn argument. Include this argument only when you want to replace a previously imported certificate.

  • When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by file://. For example, you can specify a certificate saved in the C:\temp folder as file://C:\temp\certificate_to_import.pem. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs.

  • When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you're using.

This operation returns the Amazon Resource Name (ARN) of the imported certificate.

Request Syntax

{ "Certificate": blob, "CertificateArn": "string", "CertificateChain": blob, "PrivateKey": blob }

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.

Certificate

The certificate to import.

Type: Base64-encoded binary data object

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

Required: Yes

PrivateKey

The private key that matches the public key in the certificate.

Type: Base64-encoded binary data object

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

Required: Yes

CertificateArn

The Amazon Resource Name (ARN) of an imported certificate to replace. To import a new certificate, omit this field.

Type: String

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

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

Required: No

CertificateChain

The PEM encoded certificate chain.

Type: Base64-encoded binary data object

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

Required: No

Response Syntax

{ "CertificateArn": "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.

CertificateArn

The Amazon Resource Name (ARN) of the imported certificate.

Type: String

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

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

Errors

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

LimitExceededException

An ACM limit has been exceeded.

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

Example

Import a certificate

Sample Request

POST / HTTP/1.1 Host: acm.us-east-1.amazonaws.com X-Amz-Target: CertificateManager.ImportCertificate X-Amz-Date: 20161011T184744Z Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=key_ID/20161011/us-east-1/acm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=60f965247476c4672c498c24ba255e52a62a7e4bd8678d8ee788af5ffe42f377 { "CertificateChain": "Base64-encoded blob", "PrivateKey": "Base64-encoded blob", "Certificate": "Base64-encoded blob" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: 32f9ab0a-8fe3-11e6-8d69-c91606b24a3f Content-Type: application/x-amz-json-1.1 Content-Length: 104 Date: Tue, 11 Oct 2016 18:47:46 GMT {"CertificateArn":"arn:aws:acm:us-east-1:111122223333:certificate/91228a40-ad89-4ce0-9f6c-07009fc8fdfb"}

See Also

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