Skip to content

get_certificate

get_certificate(
    certificate_arn: Arn, *, config_overrides: Optional[ACMClientConfig] = None
) -> GetCertificateResponse

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.

Parameters:

  • certificate_arn (Arn) –

    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).

Raises:

  • InvalidArnException –

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

  • RequestInProgressException –

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

  • ResourceNotFoundException –

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

  • ValidationException –

    The supplied input failed to satisfy constraints of an Amazon Web Services service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_acm/_services/acm.py
def get_certificate(
    self,
    certificate_arn: "capo_acm.types.arn.Arn",
    *,
    config_overrides: Optional[ACMClientConfig] = None,
) -> "capo_acm.types.get_certificate_response.GetCertificateResponse":
    """<p>Retrieves a certificate and its certificate chain. The certificate may be either a public or private certificate issued using the ACM <code>RequestCertificate</code> action, or a certificate imported into ACM using the <code>ImportCertificate</code> 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 <a href="https://wiki.openssl.org/index.php/Command_Line_Utilities">OpenSSL</a> to decode the certificates and inspect individual fields.</p>

    Args:
        certificate_arn: <p>String that contains a certificate ARN in the following format:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a>.</p>

    Raises:
        capo_acm.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
        capo_acm.errors.request_in_progress_exception.RequestInProgressException: <p>The certificate request is in process and the certificate in your account has not yet been issued.</p>
        capo_acm.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
        capo_acm.errors.validation_exception.ValidationException: <p>The supplied input failed to satisfy constraints of an Amazon Web Services service.</p>
        capo_acm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_acm.types.get_certificate_request.GetCertificateRequest]",
    ) -> OperationResponse[
        "capo_acm.types.get_certificate_response.GetCertificateResponse"
    ]:
        import capo_acm._operations.certificate_manager.get_certificate

        output, http_response = (
            capo_acm._operations.certificate_manager.get_certificate.get_certificate(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetCertificate")
    )
    input_: capo_acm.types.get_certificate_request.GetCertificateRequest = {
        "certificate_arn": certificate_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output