aws_sdk_paymentcryptographydata/operation/generate_mac_emv_pin_change/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::generate_mac_emv_pin_change::_generate_mac_emv_pin_change_output::GenerateMacEmvPinChangeOutputBuilder;
3
4pub use crate::operation::generate_mac_emv_pin_change::_generate_mac_emv_pin_change_input::GenerateMacEmvPinChangeInputBuilder;
5
6impl crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.generate_mac_emv_pin_change();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GenerateMacEmvPinChange`.
24///
25/// <p>Generates an issuer script mac for EMV payment cards that use offline PINs as the cardholder verification method (CVM).</p>
26/// <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>
27/// <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>
28/// <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>
29/// <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>
30/// <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>
31/// </note>
32/// <p><b>Cross-account use</b>: This operation can't be used across different Amazon Web Services accounts.</p>
33/// <p><b>Related operations:</b></p>
34/// <ul>
35/// <li>
36/// <p><code>EncryptData</code></p></li>
37/// <li>
38/// <p><code>GenerateMac</code></p></li>
39/// </ul>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct GenerateMacEmvPinChangeFluentBuilder {
42    handle: ::std::sync::Arc<crate::client::Handle>,
43    inner: crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder,
44    config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47    crate::client::customize::internal::CustomizableSend<
48        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
49        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
50    > for GenerateMacEmvPinChangeFluentBuilder
51{
52    fn send(
53        self,
54        config_override: crate::config::Builder,
55    ) -> crate::client::customize::internal::BoxFuture<
56        crate::client::customize::internal::SendResult<
57            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
58            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
59        >,
60    > {
61        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62    }
63}
64impl GenerateMacEmvPinChangeFluentBuilder {
65    /// Creates a new `GenerateMacEmvPinChangeFluentBuilder`.
66    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67        Self {
68            handle,
69            inner: ::std::default::Default::default(),
70            config_override: ::std::option::Option::None,
71        }
72    }
73    /// Access the GenerateMacEmvPinChange as a reference.
74    pub fn as_input(&self) -> &crate::operation::generate_mac_emv_pin_change::builders::GenerateMacEmvPinChangeInputBuilder {
75        &self.inner
76    }
77    /// Sends the request and returns the response.
78    ///
79    /// If an error occurs, an `SdkError` will be returned with additional details that
80    /// can be matched against.
81    ///
82    /// By default, any retryable failures will be retried twice. Retry behavior
83    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84    /// set when configuring the client.
85    pub async fn send(
86        self,
87    ) -> ::std::result::Result<
88        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
89        ::aws_smithy_runtime_api::client::result::SdkError<
90            crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
91            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92        >,
93    > {
94        let input = self
95            .inner
96            .build()
97            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98        let runtime_plugins = crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChange::operation_runtime_plugins(
99            self.handle.runtime_plugins.clone(),
100            &self.handle.conf,
101            self.config_override,
102        );
103        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChange::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeOutput,
111        crate::operation::generate_mac_emv_pin_change::GenerateMacEmvPinChangeError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>The <code>keyARN</code> of the PEK protecting the incoming new encrypted PIN block.</p>
126    pub fn new_pin_pek_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.new_pin_pek_identifier(input.into());
128        self
129    }
130    /// <p>The <code>keyARN</code> of the PEK protecting the incoming new encrypted PIN block.</p>
131    pub fn set_new_pin_pek_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_new_pin_pek_identifier(input);
133        self
134    }
135    /// <p>The <code>keyARN</code> of the PEK protecting the incoming new encrypted PIN block.</p>
136    pub fn get_new_pin_pek_identifier(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_new_pin_pek_identifier()
138    }
139    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
140    pub fn new_encrypted_pin_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.new_encrypted_pin_block(input.into());
142        self
143    }
144    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
145    pub fn set_new_encrypted_pin_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_new_encrypted_pin_block(input);
147        self
148    }
149    /// <p>The incoming new encrypted PIN block data for offline pin change on an EMV card.</p>
150    pub fn get_new_encrypted_pin_block(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_new_encrypted_pin_block()
152    }
153    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
154    pub fn pin_block_format(mut self, input: crate::types::PinBlockFormatForEmvPinChange) -> Self {
155        self.inner = self.inner.pin_block_format(input);
156        self
157    }
158    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
159    pub fn set_pin_block_format(mut self, input: ::std::option::Option<crate::types::PinBlockFormatForEmvPinChange>) -> Self {
160        self.inner = self.inner.set_pin_block_format(input);
161        self
162    }
163    /// <p>The PIN encoding format of the incoming new encrypted PIN block as specified in ISO 9564.</p>
164    pub fn get_pin_block_format(&self) -> &::std::option::Option<crate::types::PinBlockFormatForEmvPinChange> {
165        self.inner.get_pin_block_format()
166    }
167    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
168    pub fn secure_messaging_integrity_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.secure_messaging_integrity_key_identifier(input.into());
170        self
171    }
172    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
173    pub fn set_secure_messaging_integrity_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_secure_messaging_integrity_key_identifier(input);
175        self
176    }
177    /// <p>The <code>keyARN</code> of the issuer master key (IMK-SMI) used to authenticate the issuer script response.</p>
178    pub fn get_secure_messaging_integrity_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_secure_messaging_integrity_key_identifier()
180    }
181    /// <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>
182    pub fn secure_messaging_confidentiality_key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.secure_messaging_confidentiality_key_identifier(input.into());
184        self
185    }
186    /// <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>
187    pub fn set_secure_messaging_confidentiality_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_secure_messaging_confidentiality_key_identifier(input);
189        self
190    }
191    /// <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>
192    pub fn get_secure_messaging_confidentiality_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_secure_messaging_confidentiality_key_identifier()
194    }
195    /// <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>
196    pub fn message_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.message_data(input.into());
198        self
199    }
200    /// <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>
201    pub fn set_message_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_message_data(input);
203        self
204    }
205    /// <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>
206    pub fn get_message_data(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_message_data()
208    }
209    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
210    pub fn derivation_method_attributes(mut self, input: crate::types::DerivationMethodAttributes) -> Self {
211        self.inner = self.inner.derivation_method_attributes(input);
212        self
213    }
214    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
215    pub fn set_derivation_method_attributes(mut self, input: ::std::option::Option<crate::types::DerivationMethodAttributes>) -> Self {
216        self.inner = self.inner.set_derivation_method_attributes(input);
217        self
218    }
219    /// <p>The attributes and data values to derive payment card specific confidentiality and integrity keys.</p>
220    pub fn get_derivation_method_attributes(&self) -> &::std::option::Option<crate::types::DerivationMethodAttributes> {
221        self.inner.get_derivation_method_attributes()
222    }
223}