import_certificate
async
¶
import_certificate(
usage: CertificateUsageType,
certificate: CertificateBodyType,
*,
config_overrides: Optional[AsyncTransferClientConfig] = None,
certificate_chain: Optional[CertificateChainType] = None,
private_key: Optional[PrivateKeyType] = None,
active_date: Optional[CertDate] = None,
inactive_date: Optional[CertDate] = None,
description: Optional[Description] = None,
tags: Optional[Tags] = None,
) -> ImportCertificateResponse
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.
After importing a certificate, Transfer Family automatically creates a Amazon CloudWatch metric called DaysUntilExpiry that tracks the number of days until the certificate expires. The metric is based on the InactiveDate parameter and is published daily in the AWS/Transfer namespace.
It can take up to a full day after importing a certificate for Transfer Family to emit the DaysUntilExpiry metric to your account.
If you use the Certificate parameter to upload both the certificate and its chain, don't use the CertificateChain parameter.
CloudWatch monitoring
The DaysUntilExpiry metric includes the following specifications:
-
Units: Count (days)
-
Dimensions:
CertificateId(always present),Description(if provided during certificate import) -
Statistics: Minimum, Maximum, Average
-
Frequency: Published daily
Parameters:
-
usage(CertificateUsageType) –Specifies how this certificate is used. It can be used in the following ways:
-
SIGNING: For signing AS2 messages -
ENCRYPTION: For encrypting AS2 messages -
TLS: For securing AS2 communications sent over HTTPS
-
-
certificate(CertificateBodyType) –-
For the CLI, provide a file path for a certificate in URI format. For example,
--certificate file://encryption-cert.pem. Alternatively, you can provide the raw content. -
For the SDK, specify the raw content of a certificate file. For example,
--certificate "`cat encryption-cert.pem`".
You can provide both the certificate and its chain in this parameter, without needing to use the
CertificateChainparameter. If you use this parameter for both the certificate and its chain, do not use theCertificateChainparameter. -
-
certificate_chain(Optional[CertificateChainType], default:None) –An optional list of certificates that make up the chain for the certificate that's being imported.
-
private_key(Optional[PrivateKeyType], default:None) –-
For the CLI, provide a file path for a private key in URI format. For example,
--private-key file://encryption-key.pem. Alternatively, you can provide the raw content of the private key file. -
For the SDK, specify the raw content of a private key file. For example,
--private-key "`cat encryption-key.pem`"
-
-
active_date(Optional[CertDate], default:None) –An optional date that specifies when the certificate becomes active. If you do not specify a value,
ActiveDatetakes the same value asNotBeforeDate, which is specified by the CA. -
inactive_date(Optional[CertDate], default:None) –An optional date that specifies when the certificate becomes inactive. If you do not specify a value,
InactiveDatetakes the same value asNotAfterDate, which is specified by the CA. -
description(Optional[Description], default:None) –A short description that helps identify the certificate.
-
tags(Optional[Tags], default:None) –Key-value pairs that can be used to group and search for certificates.
Raises:
-
InternalServiceError–This exception is thrown when an error occurs in the Transfer Family service.
-
InvalidRequestException–This exception is thrown when the client submits a malformed request.
-
ResourceNotFoundException–This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.
-
ServiceUnavailableException–The request has failed because the Amazon Web ServicesTransfer Family service is not available.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_transfer/_services/async_transfer.py
2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 | |