- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ImportCertificateCommand
Imports the signing and encryption certificates that you need to create local (AS2) profiles and partner profiles.
You can import both the certificate and its chain in the Certificate
parameter.
If you use the Certificate
parameter to upload both the certificate and its chain, don't use the CertificateChain
parameter.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { TransferClient, ImportCertificateCommand } from "@aws-sdk/client-transfer"; // ES Modules import
// const { TransferClient, ImportCertificateCommand } = require("@aws-sdk/client-transfer"); // CommonJS import
const client = new TransferClient(config);
const input = { // ImportCertificateRequest
Usage: "SIGNING" || "ENCRYPTION" || "TLS", // required
Certificate: "STRING_VALUE", // required
CertificateChain: "STRING_VALUE",
PrivateKey: "STRING_VALUE",
ActiveDate: new Date("TIMESTAMP"),
InactiveDate: new Date("TIMESTAMP"),
Description: "STRING_VALUE",
Tags: [ // Tags
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
};
const command = new ImportCertificateCommand(input);
const response = await client.send(command);
// { // ImportCertificateResponse
// CertificateId: "STRING_VALUE", // required
// };
ImportCertificateCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Certificate Required | string | undefined |
You can provide both the certificate and its chain in this parameter, without needing to use the |
Usage Required | CertificateUsageType | undefined | Specifies how this certificate is used. It can be used in the following ways:
|
ActiveDate | Date | undefined | An optional date that specifies when the certificate becomes active. If you do not specify a value, |
CertificateChain | string | undefined | An optional list of certificates that make up the chain for the certificate that's being imported. |
Description | string | undefined | A short description that helps identify the certificate. |
InactiveDate | Date | undefined | An optional date that specifies when the certificate becomes inactive. If you do not specify a value, |
PrivateKey | string | undefined |
|
Tags | Tag[] | undefined | Key-value pairs that can be used to group and search for certificates. |
ImportCertificateCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
CertificateId Required | string | undefined | An array of identifiers for the imported certificates. You use this identifier for working with profiles and partner profiles. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServiceError | server | This exception is thrown when an error occurs in the Transfer Family service. |
InvalidRequestException | client | This exception is thrown when the client submits a malformed request. |
ResourceNotFoundException | client | This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service. |
ServiceUnavailableException | server | The request has failed because the Amazon Web ServicesTransfer Family service is not available. |
TransferServiceException | Base exception class for all service exceptions from Transfer service. |