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

ImportCertificate

Imports an SSL/TLS certificate into AWS Certificate Manager (ACM) to use with ACM's integrated AWS services.

Note

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

For more information about importing certificates into ACM, including the differences between certificates that you import and those that ACM provides, see Importing Certificates in the AWS Certificate Manager User Guide.

To import a certificate, you must provide the certificate and the matching private key. When the certificate is not self-signed, you must also provide a certificate chain. You can omit the certificate chain when importing a self-signed certificate.

The certificate, private key, and certificate chain must be PEM-encoded. For more information about converting these items to PEM format, see Importing Certificates Troubleshooting in the AWS Certificate Manager User Guide.

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

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. It must meet the following requirements:

  • Must be PEM-encoded.

  • Must contain a 1024-bit or 2048-bit RSA public key.

  • Must be valid at the time of import. You cannot import a certificate before its validity period begins (the certificate's NotBefore date) or after it expires (the certificate's NotAfter date).

Type: Base64-encoded binary data

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

Required: Yes

PrivateKey

The private key that matches the public key in the certificate. It must meet the following requirements:

  • Must be PEM-encoded.

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

Type: Base64-encoded binary data

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 certificate chain. It must be PEM-encoded.

Type: Base64-encoded binary data

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. For example, you may have input more domains than are allowed or you've requested too many certificates for your account. See the exception message returned by ACM to determine which limit you have violated. For more information about ACM limits, see the Limits topic.

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=AKIAI44QH8DHBEXAMPLE/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"}