PaymentCryptographyDataPlane / Client / generate_auth_request_cryptogram

generate_auth_request_cryptogram

PaymentCryptographyDataPlane.Client.generate_auth_request_cryptogram(**kwargs)

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.

Warning

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:

  • VerifyAuthRequestCryptogram

See also: AWS API Documentation

Request Syntax

response = client.generate_auth_request_cryptogram(
    KeyIdentifier='string',
    TransactionData='string',
    MajorKeyDerivationMode='EMV_OPTION_A'|'EMV_OPTION_B',
    SessionKeyDerivationAttributes={
        'EmvCommon': {
            'PrimaryAccountNumber': 'string',
            'PanSequenceNumber': 'string',
            'ApplicationTransactionCounter': 'string'
        },
        'Mastercard': {
            'PrimaryAccountNumber': 'string',
            'PanSequenceNumber': 'string',
            'ApplicationTransactionCounter': 'string',
            'UnpredictableNumber': 'string'
        },
        'Emv2000': {
            'PrimaryAccountNumber': 'string',
            'PanSequenceNumber': 'string',
            'ApplicationTransactionCounter': 'string'
        },
        'Amex': {
            'PrimaryAccountNumber': 'string',
            'PanSequenceNumber': 'string'
        },
        'Visa': {
            'PrimaryAccountNumber': 'string',
            'PanSequenceNumber': 'string'
        }
    }
)
Parameters:
  • KeyIdentifier (string) –

    [REQUIRED]

    The keyARN of the IMK-AC (TR31_E0_EMV_MKEY_APP_CRYPTOGRAMS) that Amazon Web Services Payment Cryptography uses to generate the ARQC.

  • TransactionData (string) –

    [REQUIRED]

    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.

  • MajorKeyDerivationMode (string) –

    [REQUIRED]

    The method to use when deriving the major encryption key for ARQC generation within Amazon Web Services Payment Cryptography.

  • SessionKeyDerivationAttributes (dict) –

    [REQUIRED]

    The attributes and values to use for deriving a session key for ARQC generation within Amazon Web Services Payment Cryptography.

    Note

    This is a Tagged Union structure. Only one of the following top level keys can be set: EmvCommon, Mastercard, Emv2000, Amex, Visa.

    • EmvCommon (dict) –

      Parameters to derive session key for an Emv common payment card for ARQC verification.

      • PrimaryAccountNumber (string) – [REQUIRED]

        The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder.

      • PanSequenceNumber (string) – [REQUIRED]

        A number that identifies and differentiates payment cards with the same Primary Account Number (PAN).

      • ApplicationTransactionCounter (string) – [REQUIRED]

        The transaction counter that is provided by the terminal during transaction processing.

    • Mastercard (dict) –

      Parameters to derive session key for a Mastercard payment card for ARQC verification.

      • PrimaryAccountNumber (string) – [REQUIRED]

        The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder.

      • PanSequenceNumber (string) – [REQUIRED]

        A number that identifies and differentiates payment cards with the same Primary Account Number (PAN).

      • ApplicationTransactionCounter (string) – [REQUIRED]

        The transaction counter that is provided by the terminal during transaction processing.

      • UnpredictableNumber (string) – [REQUIRED]

        A random number generated by the issuer.

    • Emv2000 (dict) –

      Parameters to derive session key for an Emv2000 payment card for ARQC verification.

      • PrimaryAccountNumber (string) – [REQUIRED]

        The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder.

      • PanSequenceNumber (string) – [REQUIRED]

        A number that identifies and differentiates payment cards with the same Primary Account Number (PAN).

      • ApplicationTransactionCounter (string) – [REQUIRED]

        The transaction counter that is provided by the terminal during transaction processing.

    • Amex (dict) –

      Parameters to derive session key for an Amex payment card for ARQC verification.

      • PrimaryAccountNumber (string) – [REQUIRED]

        The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder.

      • PanSequenceNumber (string) – [REQUIRED]

        A number that identifies and differentiates payment cards with the same Primary Account Number (PAN).

    • Visa (dict) –

      Parameters to derive session key for a Visa payment cardfor ARQC verification.

      • PrimaryAccountNumber (string) – [REQUIRED]

        The Primary Account Number (PAN) of the cardholder. A PAN is a unique identifier for a payment credit or debit card and associates the card to a specific account holder.

      • PanSequenceNumber (string) – [REQUIRED]

        A number that identifies and differentiates payment cards with the same Primary Account Number (PAN).

Return type:

dict

Returns:

Response Syntax

{
    'KeyArn': 'string',
    'KeyCheckValue': 'string',
    'AuthRequestCryptogram': 'string'
}

Response Structure

  • (dict) –

    • KeyArn (string) –

      The keyARN of the IMK-AC that Amazon Web Services Payment Cryptography uses for ARQC generation.

    • KeyCheckValue (string) –

      The key check value (KCV) of the encryption key. The KCV is used to check if all parties holding a given key have the same key or to detect that a key has changed.

      Amazon Web Services Payment Cryptography computes the KCV according to the CMAC specification.

    • AuthRequestCryptogram (string) –

      The Authorization Request Cryptogram (ARQC) generated by Amazon Web Services Payment Cryptography using the specified key and transaction data.

Exceptions

  • PaymentCryptographyDataPlane.Client.exceptions.ValidationException

  • PaymentCryptographyDataPlane.Client.exceptions.AccessDeniedException

  • PaymentCryptographyDataPlane.Client.exceptions.ResourceNotFoundException

  • PaymentCryptographyDataPlane.Client.exceptions.ThrottlingException

  • PaymentCryptographyDataPlane.Client.exceptions.InternalServerException