aws-sdk-acmpca 1.71.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;

impl crate::operation::import_certificate_authority_certificate::builders::ImportCertificateAuthorityCertificateInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.import_certificate_authority_certificate();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// 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>Authority key identifier</p></li>
/// <li>
/// <p>Basic constraints (<i>must</i> be marked critical)</p></li>
/// <li>
/// <p>Certificate policies</p></li>
/// <li>
/// <p>Extended key usage</p></li>
/// <li>
/// <p>Inhibit anyPolicy</p></li>
/// <li>
/// <p>Issuer alternative name</p></li>
/// <li>
/// <p>Key usage</p></li>
/// <li>
/// <p>Name constraints</p></li>
/// <li>
/// <p>Policy mappings</p></li>
/// <li>
/// <p>Subject alternative name</p></li>
/// <li>
/// <p>Subject directory attributes</p></li>
/// <li>
/// <p>Subject key identifier</p></li>
/// <li>
/// <p>Subject information access</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>Authority information access</p></li>
/// <li>
/// <p>CRL distribution points</p></li>
/// <li>
/// <p>Freshest CRL</p></li>
/// <li>
/// <p>Policy constraints</p></li>
/// </ul>
/// <p>Amazon Web Services Private Certificate Authority will also reject any other extension marked as critical not contained on the preceding list of allowed extensions.</p>
#[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,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateOutput,
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError,
    > for ImportCertificateAuthorityCertificateFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateOutput,
            crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ImportCertificateAuthorityCertificateFluentBuilder {
    /// Creates a new `ImportCertificateAuthorityCertificateFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ImportCertificateAuthorityCertificate as a reference.
    pub fn as_input(
        &self,
    ) -> &crate::operation::import_certificate_authority_certificate::builders::ImportCertificateAuthorityCertificateInputBuilder {
        &self.inner
    }
    /// 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_runtime_api::client::result::SdkError<
            crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins =
            crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificate::operation_runtime_plugins(
                self.handle.runtime_plugins.clone(),
                &self.handle.conf,
                self.config_override,
            );
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificate::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateOutput,
        crate::operation::import_certificate_authority_certificate::ImportCertificateAuthorityCertificateError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        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 certificate_authority_arn(mut self, input: impl ::std::convert::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 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 get_certificate_authority_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_certificate_authority_arn()
    }
    /// <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>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 get_certificate(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        self.inner.get_certificate()
    }
    /// <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
    }
    /// <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 get_certificate_chain(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
        self.inner.get_certificate_chain()
    }
}