Skip to content

get_certificate

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

Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the IssueCertificate action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the GetCertificate action. You can retrieve the certificate if it is in the ISSUED, EXPIRED, or REVOKED state. You can call the CreateCertificateAuthorityAuditReport action to create a report that contains information about all of the certificates issued and revoked by your private CA.

Parameters:

  • certificate_authority_arn (Arn) –

    The Amazon Resource Name (ARN) that was returned when you called CreateCertificateAuthority. This must be of the form:

    arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012 .

  • certificate_arn (Arn) –

    The ARN of the issued certificate. The ARN contains the certificate serial number and must be in the following form:

    arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012/certificate/286535153982981100925020015808220737245

Raises:

Source code in docs_src/capo_acm_pca/_services/acmpca.py
def get_certificate(
    self,
    certificate_authority_arn: "capo_acm_pca.types.arn.Arn",
    certificate_arn: "capo_acm_pca.types.arn.Arn",
    *,
    config_overrides: Optional[ACMPCAClientConfig] = None,
) -> "capo_acm_pca.types.get_certificate_response.GetCertificateResponse":
    """<p>Retrieves a certificate from your private CA or one that has been shared with you. The ARN of the certificate is returned when you call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_IssueCertificate.html">IssueCertificate</a> action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the <b>GetCertificate</b> action. You can retrieve the certificate if it is in the <b>ISSUED</b>, <b>EXPIRED</b>, or <b>REVOKED</b> state. You can call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthorityAuditReport.html">CreateCertificateAuthorityAuditReport</a> action to create a report that contains information about all of the certificates issued and revoked by your private CA. </p>

    Args:
        certificate_authority_arn: <p>The Amazon Resource Name (ARN) that was returned when you called <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
        certificate_arn: <p>The ARN of the issued certificate. The ARN contains the certificate serial number and must be in the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>/certificate/<i>286535153982981100925020015808220737245</i> </code> </p>

    Raises:
        capo_acm_pca.errors.invalid_arn_exception.InvalidArnException: <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
        capo_acm_pca.errors.invalid_state_exception.InvalidStateException: <p>The state of the private CA does not allow this action to occur.</p>
        capo_acm_pca.errors.request_failed_exception.RequestFailedException: <p>The request has failed for an unspecified reason.</p>
        capo_acm_pca.errors.request_in_progress_exception.RequestInProgressException: <p>Your request is already in progress.</p>
        capo_acm_pca.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource such as a private CA, S3 bucket, certificate, audit report, or policy cannot be found.</p>
        capo_acm_pca.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_acm_pca._operations.acm_private_ca.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_pca.types.get_certificate_request.GetCertificateRequest = {
        "certificate_authority_arn": certificate_authority_arn,
        "certificate_arn": certificate_arn,
    }

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