aws-sdk-paymentcryptographydata 1.105.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_mac_emv_pin_change::_generate_mac_emv_pin_change_input::GenerateMacEmvPinChangeInputBuilder;

pub use crate::operation::generate_mac_emv_pin_change::_generate_mac_emv_pin_change_output::GenerateMacEmvPinChangeOutputBuilder;

impl crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder {
    /// 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_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.generate_mac_emv_pin_change();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GenerateMacEmvPinChange`.
///
/// <p>Generates an issuer script mac for EMV payment cards that use offline PINs as the cardholder verification method (CVM).</p>
/// <p>This operation generates an authenticated issuer script response by appending the incoming message data (APDU command) with the target encrypted PIN block in ISO2 format. The command structure and method to send the issuer script update to the card is not defined by this operation and is typically determined by the applicable payment card scheme.</p>
/// <p>The primary inputs to this operation include the incoming new encrypted pinblock, PIN encryption key (PEK), issuer master key (IMK), primary account number (PAN), and the payment card derivation method.</p>
/// <p>The operation uses two issuer master keys - secure messaging for confidentiality (IMK-SMC) and secure messaging for integrity (IMK-SMI). The SMC key is used to internally derive a key to secure the pin, while SMI key is used to internally derive a key to authenticate the script reponse as per the <a href="https://www.emvco.com/specifications/">EMV 4.4 - Book 2 - Security and Key Management</a> specification.</p>
/// <p>This operation supports Amex, EMV2000, EMVCommon, Mastercard and Visa derivation methods, each requiring specific input parameters. Users must follow the specific derivation method and input parameters defined by the respective payment card scheme.</p><note>
/// <p>Use <code>GenerateMac</code> operation when sending a script update to an EMV card that does not involve PIN change. When assigning IAM permissions, it is important to understand that <code>EncryptData</code> using EMV keys and <code>GenerateMac</code> perform similar functions to this command.</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>EncryptData</code></p></li>
/// <li>
/// <p><code>GenerateMac</code></p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GenerateMacEmvPinChangeFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
    > for GenerateMacEmvPinChangeFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GenerateMacEmvPinChangeFluentBuilder {
    /// Creates a new `GenerateMacEmvPinChangeFluentBuilder`.
    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 GenerateMacEmvPinChange as a reference.
    pub fn as_input(&self) -> &crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder {
        &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_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
            ::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_mac_emv_pin_change::GenerateMacEmvPinChange::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChange::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_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
        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 PEK protecting the incoming new encrypted PIN block.</p>
    pub fn new_pin_pek_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.new_pin_pek_identifier(input.into());
        self
    }
    /// <p>The <code>keyARN</code> of the PEK protecting the incoming new encrypted PIN block.</p>
    pub fn set_new_pin_pek_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_new_pin_pek_identifier(input);
        self
    }
    /// <p>The <code>keyARN</code> of the PEK protecting the incoming new encrypted PIN block.</p>
    pub fn get_new_pin_pek_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_new_pin_pek_identifier()
    }
    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
    pub fn new_encrypted_pin_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.new_encrypted_pin_block(input.into());
        self
    }
    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
    pub fn set_new_encrypted_pin_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_new_encrypted_pin_block(input);
        self
    }
    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
    pub fn get_new_encrypted_pin_block(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_new_encrypted_pin_block()
    }
    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
    pub fn pin_block_format(mut self, input: crate::types::PinBlockFormatForEmvPinChange) -> Self {
        self.inner = self.inner.pin_block_format(input);
        self
    }
    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
    pub fn set_pin_block_format(mut self, input: ::std::option::Option<crate::types::PinBlockFormatForEmvPinChange>) -> Self {
        self.inner = self.inner.set_pin_block_format(input);
        self
    }
    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
    pub fn get_pin_block_format(&self) -> &::std::option::Option<crate::types::PinBlockFormatForEmvPinChange> {
        self.inner.get_pin_block_format()
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
    pub fn secure_messaging_integrity_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.secure_messaging_integrity_key_identifier(input.into());
        self
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
    pub fn set_secure_messaging_integrity_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_secure_messaging_integrity_key_identifier(input);
        self
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
    pub fn get_secure_messaging_integrity_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_secure_messaging_integrity_key_identifier()
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMC) used to protect the PIN block data in the issuer script response.</p>
    pub fn secure_messaging_confidentiality_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.secure_messaging_confidentiality_key_identifier(input.into());
        self
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMC) used to protect the PIN block data in the issuer script response.</p>
    pub fn set_secure_messaging_confidentiality_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_secure_messaging_confidentiality_key_identifier(input);
        self
    }
    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMC) used to protect the PIN block data in the issuer script response.</p>
    pub fn get_secure_messaging_confidentiality_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_secure_messaging_confidentiality_key_identifier()
    }
    /// <p>The message data is the APDU command from the card reader or terminal. The target encrypted PIN block, after translation to ISO2 format, is appended to this message data to generate an issuer script response.</p>
    pub fn message_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.message_data(input.into());
        self
    }
    /// <p>The message data is the APDU command from the card reader or terminal. The target encrypted PIN block, after translation to ISO2 format, is appended to this message data to generate an issuer script response.</p>
    pub fn set_message_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_message_data(input);
        self
    }
    /// <p>The message data is the APDU command from the card reader or terminal. The target encrypted PIN block, after translation to ISO2 format, is appended to this message data to generate an issuer script response.</p>
    pub fn get_message_data(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_message_data()
    }
    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
    pub fn derivation_method_attributes(mut self, input: crate::types::DerivationMethodAttributes) -> Self {
        self.inner = self.inner.derivation_method_attributes(input);
        self
    }
    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
    pub fn set_derivation_method_attributes(mut self, input: ::std::option::Option<crate::types::DerivationMethodAttributes>) -> Self {
        self.inner = self.inner.set_derivation_method_attributes(input);
        self
    }
    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
    pub fn get_derivation_method_attributes(&self) -> &::std::option::Option<crate::types::DerivationMethodAttributes> {
        self.inner.get_derivation_method_attributes()
    }
}