Generates an Authorization Request Cryptogram (ARQC) for an EMV chip payment card authorization. For more information, see Generate auth request cryptogram in the Amazon Web Services Payment Cryptography User Guide.
ARQC generation uses an Issuer Master Key (IMK) for application cryptograms (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) to derive a session key, which is then used to generate the cryptogram from the provided transaction data (when applicable). To use this operation, you must first create or import an IMK-AC key by calling CreateKey or ImportKey. The KeyModesOfUse should be set to DeriveKey for the IMK-AC encryption key.
This operation is intended for development and testing scenarios only. It is not recommended to use this operation as a substitute for card-based cryptogram generation in production payment flows.
For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the Amazon Web Services Payment Cryptography User Guide.
Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.
Related operations:
Parameters:
-
key_identifier
(KeyArnOrKeyAliasType)
–
The keyARN of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.
-
transaction_data
(TransactionDataType)
–
The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using VerifyAuthRequestCryptogram.
-
major_key_derivation_mode
(MajorKeyDerivationMode)
–
The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.
-
session_key_derivation_attributes
(SessionKeyDerivation)
–
The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.
Raises:
Source code in docs_src/capo_payment_cryptography_data/_services/payment_cryptography_data.py
| def generate_auth_request_cryptogram(
self,
key_identifier: "capo_payment_cryptography_data.types.key_arn_or_key_alias_type.KeyArnOrKeyAliasType",
transaction_data: "capo_payment_cryptography_data.types.transaction_data_type.TransactionDataType",
major_key_derivation_mode: "capo_payment_cryptography_data.types.major_key_derivation_mode.MajorKeyDerivationMode",
session_key_derivation_attributes: "capo_payment_cryptography_data.types.session_key_derivation.SessionKeyDerivation",
*,
config_overrides: Optional[PaymentCryptographyDataClientConfig] = None,
) -> "capo_payment_cryptography_data.types.generate_auth_request_cryptogram_output.GenerateAuthRequestCryptogramOutput":
"""<p>Generates an Authorization Request Cryptogram (ARQC) for an EMV chip payment card authorization. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/data-operations.generateauthrequestcryptogram.html">Generate auth request cryptogram</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p> <p>ARQC generation uses an Issuer Master Key (IMK) for application cryptograms (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) to derive a session key, which is then used to generate the cryptogram from the provided transaction data (when applicable). To use this operation, you must first create or import an IMK-AC key by calling <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>. The <code>KeyModesOfUse</code> should be set to <code>DeriveKey</code> for the IMK-AC encryption key.</p> <important> <p>This operation is intended for development and testing scenarios only. It is not recommended to use this operation as a substitute for card-based cryptogram generation in production payment flows.</p> </important> <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> <p> <b>Related operations:</b> </p> <ul> <li> <p> <a>VerifyAuthRequestCryptogram</a> </p> </li> </ul>
Args:
key_identifier: <p>The <code>keyARN</code> of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.</p>
transaction_data: <p>The transaction data that Amazon Web Services Payment Cryptography uses for ARQC generation. The same transaction data is used for ARQC verification by the issuer using <a>VerifyAuthRequestCryptogram</a>.</p>
major_key_derivation_mode: <p>The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
session_key_derivation_attributes: <p>The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.</p>
Raises:
capo_payment_cryptography_data.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
capo_payment_cryptography_data.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
capo_payment_cryptography_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was denied due to an invalid resource error.</p>
capo_payment_cryptography_data.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
capo_payment_cryptography_data.errors.validation_exception.ValidationException: <p>The request was denied due to an invalid request error.</p>
capo_payment_cryptography_data.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_payment_cryptography_data.types.generate_auth_request_cryptogram_input.GenerateAuthRequestCryptogramInput]",
) -> OperationResponse[
"capo_payment_cryptography_data.types.generate_auth_request_cryptogram_output.GenerateAuthRequestCryptogramOutput"
]:
import capo_payment_cryptography_data._operations.payment_cryptography_data_plane.generate_auth_request_cryptogram
output, http_response = (
capo_payment_cryptography_data._operations.payment_cryptography_data_plane.generate_auth_request_cryptogram.generate_auth_request_cryptogram(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_payment_cryptography_data.types.generate_auth_request_cryptogram_input.GenerateAuthRequestCryptogramInput",
) -> dict[str, Any]:
import capo_payment_cryptography_data.types.generate_auth_request_cryptogram_input
return capo_payment_cryptography_data.types.generate_auth_request_cryptogram_input.redact_sensitive(
input_
)
def _redact_output(
output: "capo_payment_cryptography_data.types.generate_auth_request_cryptogram_output.GenerateAuthRequestCryptogramOutput",
) -> dict[str, Any]:
import capo_payment_cryptography_data.types.generate_auth_request_cryptogram_output
return capo_payment_cryptography_data.types.generate_auth_request_cryptogram_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"GenerateAuthRequestCryptogram",
redact_input=_redact_input,
redact_output=_redact_output,
),
)
input_: capo_payment_cryptography_data.types.generate_auth_request_cryptogram_input.GenerateAuthRequestCryptogramInput = {
"key_identifier": key_identifier,
"transaction_data": transaction_data,
"major_key_derivation_mode": major_key_derivation_mode,
"session_key_derivation_attributes": session_key_derivation_attributes,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|