aws-sdk-paymentcryptographydata 1.104.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::translate_key_material::_translate_key_material_input::TranslateKeyMaterialInputBuilder;

pub use crate::operation::translate_key_material::_translate_key_material_output::TranslateKeyMaterialOutputBuilder;

impl crate::operation::translate_key_material::builders::TranslateKeyMaterialInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::translate_key_material::TranslateKeyMaterialOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::translate_key_material::TranslateKeyMaterialError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.translate_key_material();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `TranslateKeyMaterial`.
///
/// <p>Translates an cryptographic key between different wrapping keys without importing the key into Amazon Web Services Payment Cryptography.</p>
/// <p>This operation can be used when key material is frequently rotated, such as during every card transaction, and there is a need to avoid importing short-lived keys into Amazon Web Services Payment Cryptography. It translates short-lived transaction keys such as <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.pek">PEK</a> generated for each transaction and wrapped with an <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.ecdh">ECDH</a> derived wrapping key to another <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/terminology.html#terms.kek">KEK</a> wrapping key.</p>
/// <p>Before using this operation, you must first request the public key certificate of the ECC key pair generated within Amazon Web Services Payment Cryptography to establish an ECDH key agreement. In <code>TranslateKeyData</code>, the service uses its own ECC key pair, public certificate of receiving ECC key pair, and the key derivation parameters to generate a derived key. The service uses this derived key to unwrap the incoming transaction key received as a TR31WrappedKeyBlock and re-wrap using a user provided KEK to generate an outgoing Tr31WrappedKeyBlock.</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 can't be used across different Amazon Web Services accounts.</p>
/// <p><b>Related operations:</b></p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_CreateKey.html">CreateKey</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetPublicKeyCertificate.html">GetPublicCertificate</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_ImportKey.html">ImportKey</a></p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct TranslateKeyMaterialFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::translate_key_material::builders::TranslateKeyMaterialInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::translate_key_material::TranslateKeyMaterialOutput,
        crate::operation::translate_key_material::TranslateKeyMaterialError,
    > for TranslateKeyMaterialFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::translate_key_material::TranslateKeyMaterialOutput,
            crate::operation::translate_key_material::TranslateKeyMaterialError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl TranslateKeyMaterialFluentBuilder {
    /// Creates a new `TranslateKeyMaterialFluentBuilder`.
    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 TranslateKeyMaterial as a reference.
    pub fn as_input(&self) -> &crate::operation::translate_key_material::builders::TranslateKeyMaterialInputBuilder {
        &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::translate_key_material::TranslateKeyMaterialOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::translate_key_material::TranslateKeyMaterialError,
            ::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::translate_key_material::TranslateKeyMaterial::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::translate_key_material::TranslateKeyMaterial::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::translate_key_material::TranslateKeyMaterialOutput,
        crate::operation::translate_key_material::TranslateKeyMaterialError,
        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>Parameter information of the TR31WrappedKeyBlock containing the transaction key.</p>
    pub fn incoming_key_material(mut self, input: crate::types::IncomingKeyMaterial) -> Self {
        self.inner = self.inner.incoming_key_material(input);
        self
    }
    /// <p>Parameter information of the TR31WrappedKeyBlock containing the transaction key.</p>
    pub fn set_incoming_key_material(mut self, input: ::std::option::Option<crate::types::IncomingKeyMaterial>) -> Self {
        self.inner = self.inner.set_incoming_key_material(input);
        self
    }
    /// <p>Parameter information of the TR31WrappedKeyBlock containing the transaction key.</p>
    pub fn get_incoming_key_material(&self) -> &::std::option::Option<crate::types::IncomingKeyMaterial> {
        self.inner.get_incoming_key_material()
    }
    /// <p>Parameter information of the wrapping key used to wrap the transaction key in the outgoing TR31WrappedKeyBlock.</p>
    pub fn outgoing_key_material(mut self, input: crate::types::OutgoingKeyMaterial) -> Self {
        self.inner = self.inner.outgoing_key_material(input);
        self
    }
    /// <p>Parameter information of the wrapping key used to wrap the transaction key in the outgoing TR31WrappedKeyBlock.</p>
    pub fn set_outgoing_key_material(mut self, input: ::std::option::Option<crate::types::OutgoingKeyMaterial>) -> Self {
        self.inner = self.inner.set_outgoing_key_material(input);
        self
    }
    /// <p>Parameter information of the wrapping key used to wrap the transaction key in the outgoing TR31WrappedKeyBlock.</p>
    pub fn get_outgoing_key_material(&self) -> &::std::option::Option<crate::types::OutgoingKeyMaterial> {
        self.inner.get_outgoing_key_material()
    }
    /// <p>The key check value (KCV) algorithm used for calculating the KCV of the derived key.</p>
    pub fn key_check_value_algorithm(mut self, input: crate::types::KeyCheckValueAlgorithm) -> Self {
        self.inner = self.inner.key_check_value_algorithm(input);
        self
    }
    /// <p>The key check value (KCV) algorithm used for calculating the KCV of the derived key.</p>
    pub fn set_key_check_value_algorithm(mut self, input: ::std::option::Option<crate::types::KeyCheckValueAlgorithm>) -> Self {
        self.inner = self.inner.set_key_check_value_algorithm(input);
        self
    }
    /// <p>The key check value (KCV) algorithm used for calculating the KCV of the derived key.</p>
    pub fn get_key_check_value_algorithm(&self) -> &::std::option::Option<crate::types::KeyCheckValueAlgorithm> {
        self.inner.get_key_check_value_algorithm()
    }
}