aws-sdk-paymentcryptographydata 1.110.0

AWS SDK for Payment Cryptography Data Plane
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::generate_as2805_kek_validation::_generate_as2805_kek_validation_input::GenerateAs2805KekValidationInputBuilder;

pub use crate::operation::generate_as2805_kek_validation::_generate_as2805_kek_validation_output::GenerateAs2805KekValidationOutputBuilder;

impl crate::operation::generate_as2805_kek_validation::builders::GenerateAs2805KekValidationInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.generate_as2805_kek_validation();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GenerateAs2805KekValidation`.
///
/// <p>Generates a <code>KekValidationRequest</code> or a <code>KekValidationResponse</code> for node-to-node initialization between payment processing nodes using <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.html">Australian Standard 2805 (AS2805)</a>.</p>
/// <p>During node-to-node initialization, both communicating nodes must validate that they possess the correct Key Encrypting Keys (KEKs) before proceeding with session key exchange. In AS2805, the sending KEK (KEKs) of one node corresponds to the receiving KEK (KEKr) of its partner node. Each node uses its KEK to encrypt and decrypt session keys exchanged between the nodes. A KEK can be created or imported into Amazon Web Services Payment Cryptography using either the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a> or <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a> operations.</p>
/// <p>To use <code>GenerateAs2805KekValidation</code> to generate a KEK validation request, set <code>KekValidationType</code> to <code>KekValidationRequest</code>. This operation returns both <code>RandomKeySend</code> (KRs) and <code>RandomKeyReceive</code> (KRr) as response values. The partnering node receives the KRs, uses its KEKr to decrypt it, and generates a KRr which is an inverted value of KRs. The node receiving the KRr validates it against its own KRr generated during KEK validation request outside of Amazon Web Services Payment Cryptography.</p>
/// <p>You can also use this operation to generate a KEK validation response, by setting <code>KekValidationType</code> to <code>KekValidationResponse</code> and providing the incoming KRs. This operation then calculates a KRr. To learn more about more about node-to-node initialization, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.kekvalidation.html">Validation of KEK</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p>For information about valid keys for this operation, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-validattributes.html">Understanding key attributes</a> and <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/crypto-ops-validkeys-ops.html">Key types for specific data operations</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p><b>Cross-account use</b>: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/security_iam_resource-based-policies.html">Resource-based policies</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GenerateAs2805KekValidationFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::generate_as2805_kek_validation::builders::GenerateAs2805KekValidationInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationOutput,
        crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationError,
    > for GenerateAs2805KekValidationFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationOutput,
            crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GenerateAs2805KekValidationFluentBuilder {
    /// Creates a new `GenerateAs2805KekValidationFluentBuilder`.
    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 GenerateAs2805KekValidation as a reference.
    pub fn as_input(&self) -> &crate::operation::generate_as2805_kek_validation::builders::GenerateAs2805KekValidationInputBuilder {
        &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::generate_as2805_kek_validation::GenerateAs2805KekValidationOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationError,
            ::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::generate_as2805_kek_validation::GenerateAs2805KekValidation::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidation::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::generate_as2805_kek_validation::GenerateAs2805KekValidationOutput,
        crate::operation::generate_as2805_kek_validation::GenerateAs2805KekValidationError,
        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 <code>keyARN</code> of sending KEK that Amazon Web Services Payment Cryptography uses for node-to-node initialization</p>
    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.key_identifier(input.into());
        self
    }
    /// <p>The <code>keyARN</code> of sending KEK that Amazon Web Services Payment Cryptography uses for node-to-node initialization</p>
    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_key_identifier(input);
        self
    }
    /// <p>The <code>keyARN</code> of sending KEK that Amazon Web Services Payment Cryptography uses for node-to-node initialization</p>
    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_key_identifier()
    }
    /// <p>Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.</p>
    pub fn kek_validation_type(mut self, input: crate::types::As2805KekValidationType) -> Self {
        self.inner = self.inner.kek_validation_type(input);
        self
    }
    /// <p>Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.</p>
    pub fn set_kek_validation_type(mut self, input: ::std::option::Option<crate::types::As2805KekValidationType>) -> Self {
        self.inner = self.inner.set_kek_validation_type(input);
        self
    }
    /// <p>Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.</p>
    pub fn get_kek_validation_type(&self) -> &::std::option::Option<crate::types::As2805KekValidationType> {
        self.inner.get_kek_validation_type()
    }
    /// <p>The key variant to use for generating a random key for KEK validation during node-to-node initialization.</p>
    pub fn random_key_send_variant_mask(mut self, input: crate::types::RandomKeySendVariantMask) -> Self {
        self.inner = self.inner.random_key_send_variant_mask(input);
        self
    }
    /// <p>The key variant to use for generating a random key for KEK validation during node-to-node initialization.</p>
    pub fn set_random_key_send_variant_mask(mut self, input: ::std::option::Option<crate::types::RandomKeySendVariantMask>) -> Self {
        self.inner = self.inner.set_random_key_send_variant_mask(input);
        self
    }
    /// <p>The key variant to use for generating a random key for KEK validation during node-to-node initialization.</p>
    pub fn get_random_key_send_variant_mask(&self) -> &::std::option::Option<crate::types::RandomKeySendVariantMask> {
        self.inner.get_random_key_send_variant_mask()
    }
}