// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::translate_pin_data::_translate_pin_data_input::TranslatePinDataInputBuilder;
pub use crate::operation::translate_pin_data::_translate_pin_data_output::TranslatePinDataOutputBuilder;
impl crate::operation::translate_pin_data::builders::TranslatePinDataInputBuilder {
/// 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_pin_data::TranslatePinDataOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::translate_pin_data::TranslatePinDataError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.translate_pin_data();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `TranslatePinData`.
///
/// <p>Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/translate-pin-data.html">Translate PIN data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p>PIN block translation involves changing a PIN block from one encryption key to another and optionally change its format. PIN block translation occurs entirely within the HSM boundary and PIN data never enters or leaves Amazon Web Services Payment Cryptography in clear text. The encryption key transformation can be from PEK (Pin Encryption Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK.</p>
/// <p>Amazon Web Services Payment Cryptography also supports use of dynamic keys and ECDH (Elliptic Curve Diffie-Hellman) based key exchange for this operation.</p>
/// <p>Dynamic keys allow you to pass a PEK as a TR-31 WrappedKeyBlock. They can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into Amazon Web Services Payment Cryptography. To translate PIN block using dynamic keys, the <code>keyARN</code> is the Key Encryption Key (KEK) of the TR-31 wrapped PEK. The incoming wrapped key shall have a key purpose of P0 with a mode of use of B or D. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/use-cases-acquirers-dynamickeys.html">Using Dynamic Keys</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p>Using ECDH key exchange, you can receive cardholder selectable PINs into Amazon Web Services Payment Cryptography. The ECDH derived key protects the incoming PIN block, which is translated to a PEK encrypted PIN block for use within the service. You can also use ECDH for reveal PIN, wherein the service translates the PIN block from PEK to a ECDH derived encryption key. For more information on establishing ECDH derived keys, see the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/create-keys.html">Creating keys</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p>
/// <p>The allowed combinations of PIN block format translations are guided by PCI. It is important to note that not all encrypted PIN block formats (example, format 1) require PAN (Primary Account Number) as input. And as such, PIN block format that requires PAN (example, formats 0,3,4) cannot be translated to a format (format 1) that does not require a PAN for generation.</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><note>
/// <p>Amazon Web Services Payment Cryptography currently supports ISO PIN block 4 translation for PIN block built using legacy PAN length. That is, PAN is the right most 12 digits excluding the check digits.</p>
/// </note>
/// <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><code>GeneratePinData</code></p></li>
/// <li>
/// <p><code>VerifyPinData</code></p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct TranslatePinDataFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::translate_pin_data::builders::TranslatePinDataInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::translate_pin_data::TranslatePinDataOutput,
crate::operation::translate_pin_data::TranslatePinDataError,
> for TranslatePinDataFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::translate_pin_data::TranslatePinDataOutput,
crate::operation::translate_pin_data::TranslatePinDataError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl TranslatePinDataFluentBuilder {
/// Creates a new `TranslatePinDataFluentBuilder`.
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 TranslatePinData as a reference.
pub fn as_input(&self) -> &crate::operation::translate_pin_data::builders::TranslatePinDataInputBuilder {
&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_pin_data::TranslatePinDataOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::translate_pin_data::TranslatePinDataError,
::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_pin_data::TranslatePinData::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::translate_pin_data::TranslatePinData::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_pin_data::TranslatePinDataOutput,
crate::operation::translate_pin_data::TranslatePinDataError,
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 the encryption key under which incoming PIN block data is encrypted. This key type can be PEK or BDK.</p>
/// <p>For dynamic keys, it is the <code>keyARN</code> of KEK of the TR-31 wrapped PEK. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn incoming_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.incoming_key_identifier(input.into());
self
}
/// <p>The <code>keyARN</code> of the encryption key under which incoming PIN block data is encrypted. This key type can be PEK or BDK.</p>
/// <p>For dynamic keys, it is the <code>keyARN</code> of KEK of the TR-31 wrapped PEK. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn set_incoming_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_incoming_key_identifier(input);
self
}
/// <p>The <code>keyARN</code> of the encryption key under which incoming PIN block data is encrypted. This key type can be PEK or BDK.</p>
/// <p>For dynamic keys, it is the <code>keyARN</code> of KEK of the TR-31 wrapped PEK. For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn get_incoming_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_incoming_key_identifier()
}
/// <p>The <code>keyARN</code> of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.</p>
/// <p>For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn outgoing_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.outgoing_key_identifier(input.into());
self
}
/// <p>The <code>keyARN</code> of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.</p>
/// <p>For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn set_outgoing_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_outgoing_key_identifier(input);
self
}
/// <p>The <code>keyARN</code> of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.</p>
/// <p>For ECDH, it is the <code>keyARN</code> of the asymmetric ECC key.</p>
pub fn get_outgoing_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_outgoing_key_identifier()
}
/// <p>The format of the incoming PIN block data for translation within Amazon Web Services Payment Cryptography.</p>
pub fn incoming_translation_attributes(mut self, input: crate::types::TranslationIsoFormats) -> Self {
self.inner = self.inner.incoming_translation_attributes(input);
self
}
/// <p>The format of the incoming PIN block data for translation within Amazon Web Services Payment Cryptography.</p>
pub fn set_incoming_translation_attributes(mut self, input: ::std::option::Option<crate::types::TranslationIsoFormats>) -> Self {
self.inner = self.inner.set_incoming_translation_attributes(input);
self
}
/// <p>The format of the incoming PIN block data for translation within Amazon Web Services Payment Cryptography.</p>
pub fn get_incoming_translation_attributes(&self) -> &::std::option::Option<crate::types::TranslationIsoFormats> {
self.inner.get_incoming_translation_attributes()
}
/// <p>The format of the outgoing PIN block data after translation by Amazon Web Services Payment Cryptography.</p>
pub fn outgoing_translation_attributes(mut self, input: crate::types::TranslationIsoFormats) -> Self {
self.inner = self.inner.outgoing_translation_attributes(input);
self
}
/// <p>The format of the outgoing PIN block data after translation by Amazon Web Services Payment Cryptography.</p>
pub fn set_outgoing_translation_attributes(mut self, input: ::std::option::Option<crate::types::TranslationIsoFormats>) -> Self {
self.inner = self.inner.set_outgoing_translation_attributes(input);
self
}
/// <p>The format of the outgoing PIN block data after translation by Amazon Web Services Payment Cryptography.</p>
pub fn get_outgoing_translation_attributes(&self) -> &::std::option::Option<crate::types::TranslationIsoFormats> {
self.inner.get_outgoing_translation_attributes()
}
/// <p>The encrypted PIN block data that Amazon Web Services Payment Cryptography translates.</p>
pub fn encrypted_pin_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.encrypted_pin_block(input.into());
self
}
/// <p>The encrypted PIN block data that Amazon Web Services Payment Cryptography translates.</p>
pub fn set_encrypted_pin_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_encrypted_pin_block(input);
self
}
/// <p>The encrypted PIN block data that Amazon Web Services Payment Cryptography translates.</p>
pub fn get_encrypted_pin_block(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_encrypted_pin_block()
}
/// <p>The attributes and values to use for incoming DUKPT encryption key for PIN block translation.</p>
pub fn incoming_dukpt_attributes(mut self, input: crate::types::DukptDerivationAttributes) -> Self {
self.inner = self.inner.incoming_dukpt_attributes(input);
self
}
/// <p>The attributes and values to use for incoming DUKPT encryption key for PIN block translation.</p>
pub fn set_incoming_dukpt_attributes(mut self, input: ::std::option::Option<crate::types::DukptDerivationAttributes>) -> Self {
self.inner = self.inner.set_incoming_dukpt_attributes(input);
self
}
/// <p>The attributes and values to use for incoming DUKPT encryption key for PIN block translation.</p>
pub fn get_incoming_dukpt_attributes(&self) -> &::std::option::Option<crate::types::DukptDerivationAttributes> {
self.inner.get_incoming_dukpt_attributes()
}
/// <p>The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.</p>
pub fn outgoing_dukpt_attributes(mut self, input: crate::types::DukptDerivationAttributes) -> Self {
self.inner = self.inner.outgoing_dukpt_attributes(input);
self
}
/// <p>The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.</p>
pub fn set_outgoing_dukpt_attributes(mut self, input: ::std::option::Option<crate::types::DukptDerivationAttributes>) -> Self {
self.inner = self.inner.set_outgoing_dukpt_attributes(input);
self
}
/// <p>The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.</p>
pub fn get_outgoing_dukpt_attributes(&self) -> &::std::option::Option<crate::types::DukptDerivationAttributes> {
self.inner.get_outgoing_dukpt_attributes()
}
/// <p>The WrappedKeyBlock containing the encryption key under which incoming PIN block data is encrypted.</p>
pub fn incoming_wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
self.inner = self.inner.incoming_wrapped_key(input);
self
}
/// <p>The WrappedKeyBlock containing the encryption key under which incoming PIN block data is encrypted.</p>
pub fn set_incoming_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
self.inner = self.inner.set_incoming_wrapped_key(input);
self
}
/// <p>The WrappedKeyBlock containing the encryption key under which incoming PIN block data is encrypted.</p>
pub fn get_incoming_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
self.inner.get_incoming_wrapped_key()
}
/// <p>The WrappedKeyBlock containing the encryption key for encrypting outgoing PIN block data.</p>
pub fn outgoing_wrapped_key(mut self, input: crate::types::WrappedKey) -> Self {
self.inner = self.inner.outgoing_wrapped_key(input);
self
}
/// <p>The WrappedKeyBlock containing the encryption key for encrypting outgoing PIN block data.</p>
pub fn set_outgoing_wrapped_key(mut self, input: ::std::option::Option<crate::types::WrappedKey>) -> Self {
self.inner = self.inner.set_outgoing_wrapped_key(input);
self
}
/// <p>The WrappedKeyBlock containing the encryption key for encrypting outgoing PIN block data.</p>
pub fn get_outgoing_wrapped_key(&self) -> &::std::option::Option<crate::types::WrappedKey> {
self.inner.get_outgoing_wrapped_key()
}
/// <p>The attributes and values to use for incoming AS2805 encryption key for PIN block translation.</p>
pub fn incoming_as2805_attributes(mut self, input: crate::types::As2805PekDerivationAttributes) -> Self {
self.inner = self.inner.incoming_as2805_attributes(input);
self
}
/// <p>The attributes and values to use for incoming AS2805 encryption key for PIN block translation.</p>
pub fn set_incoming_as2805_attributes(mut self, input: ::std::option::Option<crate::types::As2805PekDerivationAttributes>) -> Self {
self.inner = self.inner.set_incoming_as2805_attributes(input);
self
}
/// <p>The attributes and values to use for incoming AS2805 encryption key for PIN block translation.</p>
pub fn get_incoming_as2805_attributes(&self) -> &::std::option::Option<crate::types::As2805PekDerivationAttributes> {
self.inner.get_incoming_as2805_attributes()
}
}