aws-sdk-acmpca 0.25.0

AWS SDK for AWS Certificate Manager Private Certificate Authority
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::import_certificate_authority_certificate::_import_certificate_authority_certificate_output::ImportCertificateAuthorityCertificateOutputBuilder;

pub use crate::operation::import_certificate_authority_certificate::_import_certificate_authority_certificate_input::ImportCertificateAuthorityCertificateInputBuilder;

/// Fluent builder constructing a request to `ImportCertificateAuthorityCertificate`.
///
/// <p>Imports a signed private CA certificate into Amazon Web Services Private CA. This action is used when you are using a chain of trust whose root is located outside Amazon Web Services Private CA. Before you can call this action, the following preparations must in place:</p>
/// <ol>
/// <li> <p>In Amazon Web Services Private CA, call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_CreateCertificateAuthority.html">CreateCertificateAuthority</a> action to create the private CA that you plan to back with the imported certificate.</p> </li>
/// <li> <p>Call the <a href="https://docs.aws.amazon.com/privateca/latest/APIReference/API_GetCertificateAuthorityCsr.html">GetCertificateAuthorityCsr</a> action to generate a certificate signing request (CSR).</p> </li>
/// <li> <p>Sign the CSR using a root or intermediate CA hosted by either an on-premises PKI hierarchy or by a commercial CA.</p> </li>
/// <li> <p>Create a certificate chain and copy the signed certificate and the certificate chain to your working directory.</p> </li>
/// </ol>
/// <p>Amazon Web Services Private CA supports three scenarios for installing a CA certificate:</p>
/// <ul>
/// <li> <p>Installing a certificate for a root CA hosted by Amazon Web Services Private CA.</p> </li>
/// <li> <p>Installing a subordinate CA certificate whose parent authority is hosted by Amazon Web Services Private CA.</p> </li>
/// <li> <p>Installing a subordinate CA certificate whose parent authority is externally hosted.</p> </li>
/// </ul>
/// <p>The following additional requirements apply when you import a CA certificate.</p>
/// <ul>
/// <li> <p>Only a self-signed certificate can be imported as a root CA.</p> </li>
/// <li> <p>A self-signed certificate cannot be imported as a subordinate CA.</p> </li>
/// <li> <p>Your certificate chain must not include the private CA certificate that you are importing.</p> </li>
/// <li> <p>Your root CA must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. </p> </li>
/// <li> <p>The chain must be PEM-encoded.</p> </li>
/// <li> <p>The maximum allowed size of a certificate is 32 KB.</p> </li>
/// <li> <p>The maximum allowed size of a certificate chain is 2 MB.</p> </li>
/// </ul>
/// <p> <i>Enforcement of Critical Constraints</i> </p>
/// <p>Amazon Web Services Private CA allows the following extensions to be marked critical in the imported CA certificate or chain.</p>
/// <ul>
/// <li> <p>Basic constraints (<i>must</i> be marked critical)</p> </li>
/// <li> <p>Subject alternative names</p> </li>
/// <li> <p>Key usage</p> </li>
/// <li> <p>Extended key usage</p> </li>
/// <li> <p>Authority key identifier</p> </li>
/// <li> <p>Subject key identifier</p> </li>
/// <li> <p>Issuer alternative name</p> </li>
/// <li> <p>Subject directory attributes</p> </li>
/// <li> <p>Subject information access</p> </li>
/// <li> <p>Certificate policies</p> </li>
/// <li> <p>Policy mappings</p> </li>
/// <li> <p>Inhibit anyPolicy</p> </li>
/// </ul>
/// <p>Amazon Web Services Private CA rejects the following extensions when they are marked critical in an imported CA certificate or chain.</p>
/// <ul>
/// <li> <p>Name constraints</p> </li>
/// <li> <p>Policy constraints</p> </li>
/// <li> <p>CRL distribution points</p> </li>
/// <li> <p>Authority information access</p> </li>
/// <li> <p>Freshest CRL</p> </li>
/// <li> <p>Any other extension</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct ImportCertificateAuthorityCertificateFluentBuilder {
                handle: std::sync::Arc<crate::client::Handle>,
                inner: crate::operation::import_certificate_authority_certificate::builders::ImportCertificateAuthorityCertificateInputBuilder
            }
impl ImportCertificateAuthorityCertificateFluentBuilder {
    /// Creates a new `ImportCertificateAuthorityCertificate`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
                    pub async fn customize(self) -> std::result::Result<
                        crate::client::customize::CustomizableOperation<crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificate, aws_http::retry::AwsResponseRetryClassifier,>,
                        aws_smithy_http::result::SdkError<crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError>
    >{
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
                    pub async fn send(self) -> std::result::Result<crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateOutput, aws_smithy_http::result::SdkError<crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError>>
                     {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <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>
    pub fn certificate_authority_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.certificate_authority_arn(input.into());
        self
    }
    /// <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>
    pub fn set_certificate_authority_arn(
        mut self,
        input: std::option::Option<std::string::String>,
    ) -> Self {
        self.inner = self.inner.set_certificate_authority_arn(input);
        self
    }
    /// <p>The PEM-encoded certificate for a private CA. This may be a self-signed certificate in the case of a root CA, or it may be signed by another CA that you control.</p>
    pub fn certificate(mut self, input: aws_smithy_types::Blob) -> Self {
        self.inner = self.inner.certificate(input);
        self
    }
    /// <p>The PEM-encoded certificate for a private CA. This may be a self-signed certificate in the case of a root CA, or it may be signed by another CA that you control.</p>
    pub fn set_certificate(mut self, input: std::option::Option<aws_smithy_types::Blob>) -> Self {
        self.inner = self.inner.set_certificate(input);
        self
    }
    /// <p>A PEM-encoded file that contains all of your certificates, other than the certificate you're importing, chaining up to your root CA. Your Amazon Web Services Private CA-hosted or on-premises root certificate is the last in the chain, and each certificate in the chain signs the one preceding. </p>
    /// <p>This parameter must be supplied when you import a subordinate CA. When you import a root CA, there is no chain.</p>
    pub fn certificate_chain(mut self, input: aws_smithy_types::Blob) -> Self {
        self.inner = self.inner.certificate_chain(input);
        self
    }
    /// <p>A PEM-encoded file that contains all of your certificates, other than the certificate you're importing, chaining up to your root CA. Your Amazon Web Services Private CA-hosted or on-premises root certificate is the last in the chain, and each certificate in the chain signs the one preceding. </p>
    /// <p>This parameter must be supplied when you import a subordinate CA. When you import a root CA, there is no chain.</p>
    pub fn set_certificate_chain(
        mut self,
        input: std::option::Option<aws_smithy_types::Blob>,
    ) -> Self {
        self.inner = self.inner.set_certificate_chain(input);
        self
    }
}