Skip to content

verify_pin_data async

verify_pin_data(
    verification_key_identifier: KeyArnOrKeyAliasType,
    encryption_key_identifier: KeyArnOrKeyAliasType,
    verification_attributes: PinVerificationAttributes,
    encrypted_pin_block: EncryptedPinBlockType,
    pin_block_format: PinBlockFormatForPinData,
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
    primary_account_number: Optional[PrimaryAccountNumberType] = None,
    pin_data_length: Optional[IntegerRangeBetween4And12] = None,
    dukpt_attributes: Optional[DukptAttributes] = None,
    encryption_wrapped_key: Optional[WrappedKey] = None,
) -> VerifyPinDataOutput

Verifies pin-related data such as PIN and PIN Offset using algorithms including VISA PVV and IBM3624. For more information, see Verify PIN data in the Amazon Web Services Payment Cryptography User Guide.

This operation verifies PIN data for user payment card. A card holder PIN data is never transmitted in clear to or from Amazon Web Services Payment Cryptography. This operation uses PIN Verification Key (PVK) for PIN or PIN Offset generation and then encrypts it using PIN Encryption Key (PEK) to create an EncryptedPinBlock for transmission from Amazon Web Services Payment Cryptography.

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:

  • verification_key_identifier (KeyArnOrKeyAliasType) –

    The keyARN of the PIN verification key.

  • encryption_key_identifier (KeyArnOrKeyAliasType) –

    The keyARN of the encryption key under which the PIN block data is encrypted. This key type can be PEK or BDK.

  • verification_attributes (PinVerificationAttributes) –

    The attributes and values for PIN data verification.

  • encrypted_pin_block (EncryptedPinBlockType) –

    The encrypted PIN block data that Amazon Web Services Payment Cryptography verifies.

  • primary_account_number (Optional[PrimaryAccountNumberType], default: None ) –

    The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.

  • pin_block_format (PinBlockFormatForPinData) –

    The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports ISO_Format_0 and ISO_Format_3.

    The ISO_Format_0 PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.

    The ISO_Format_3 PIN block format is the same as ISO_Format_0 except that the fill digits are random values from 10 to 15.

  • pin_data_length (Optional[IntegerRangeBetween4And12], default: None ) –

    The length of PIN being verified.

  • dukpt_attributes (Optional[DukptAttributes], default: None ) –

    The attributes and values for the DUKPT encrypted PIN block data.

Raises:

Source code in docs_src/capo_payment_cryptography_data/_services/async_payment_cryptography_data.py
async def verify_pin_data(
    self,
    verification_key_identifier: "capo_payment_cryptography_data.types.key_arn_or_key_alias_type.KeyArnOrKeyAliasType",
    encryption_key_identifier: "capo_payment_cryptography_data.types.key_arn_or_key_alias_type.KeyArnOrKeyAliasType",
    verification_attributes: "capo_payment_cryptography_data.types.pin_verification_attributes.PinVerificationAttributes",
    encrypted_pin_block: "capo_payment_cryptography_data.types.encrypted_pin_block_type.EncryptedPinBlockType",
    pin_block_format: "capo_payment_cryptography_data.types.pin_block_format_for_pin_data.PinBlockFormatForPinData",
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
    primary_account_number: Optional[
        "capo_payment_cryptography_data.types.primary_account_number_type.PrimaryAccountNumberType"
    ] = None,
    pin_data_length: Optional[
        "capo_payment_cryptography_data.types.integer_range_between4_and12.IntegerRangeBetween4And12"
    ] = None,
    dukpt_attributes: Optional[
        "capo_payment_cryptography_data.types.dukpt_attributes.DukptAttributes"
    ] = None,
    encryption_wrapped_key: Optional[
        "capo_payment_cryptography_data.types.wrapped_key.WrappedKey"
    ] = None,
) -> "capo_payment_cryptography_data.types.verify_pin_data_output.VerifyPinDataOutput":
    """<p>Verifies pin-related data such as PIN and PIN Offset using algorithms including VISA PVV and IBM3624. For more information, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/verify-pin-data.html">Verify PIN data</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</p> <p>This operation verifies PIN data for user payment card. A card holder PIN data is never transmitted in clear to or from Amazon Web Services Payment Cryptography. This operation uses PIN Verification Key (PVK) for PIN or PIN Offset generation and then encrypts it using PIN Encryption Key (PEK) to create an <code>EncryptedPinBlock</code> for transmission from Amazon Web Services Payment Cryptography. </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> <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>GeneratePinData</a> </p> </li> <li> <p> <a>TranslatePinData</a> </p> </li> </ul>

    Args:
        verification_key_identifier: <p>The <code>keyARN</code> of the PIN verification key.</p>
        encryption_key_identifier: <p>The <code>keyARN</code> of the encryption key under which the PIN block data is encrypted. This key type can be PEK or BDK.</p>
        verification_attributes: <p>The attributes and values for PIN data verification.</p>
        encrypted_pin_block: <p>The encrypted PIN block data that Amazon Web Services Payment Cryptography verifies.</p>
        primary_account_number: <p>The Primary Account Number (PAN), a unique identifier for a payment credit or debit card that associates the card with a specific account holder.</p>
        pin_block_format: <p>The PIN encoding format for pin data generation as specified in ISO 9564. Amazon Web Services Payment Cryptography supports <code>ISO_Format_0</code> and <code>ISO_Format_3</code>.</p> <p>The <code>ISO_Format_0</code> PIN block format is equivalent to the ANSI X9.8, VISA-1, and ECI-1 PIN block formats. It is similar to a VISA-4 PIN block format. It supports a PIN from 4 to 12 digits in length.</p> <p>The <code>ISO_Format_3</code> PIN block format is the same as <code>ISO_Format_0</code> except that the fill digits are random values from 10 to 15.</p>
        pin_data_length: <p>The length of PIN being verified.</p>
        dukpt_attributes: <p>The attributes and values for the DUKPT encrypted PIN block data.</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.verification_failed_exception.VerificationFailedException: <p>This request failed verification.</p>
        capo_payment_cryptography_data.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_payment_cryptography_data.types.verify_pin_data_input.VerifyPinDataInput]",
    ) -> AsyncOperationResponse[
        "capo_payment_cryptography_data.types.verify_pin_data_output.VerifyPinDataOutput"
    ]:
        import capo_payment_cryptography_data._operations.payment_cryptography_data_plane.verify_pin_data

        (
            output,
            http_response,
        ) = await capo_payment_cryptography_data._operations.payment_cryptography_data_plane.verify_pin_data.async_verify_pin_data(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_payment_cryptography_data.types.verify_pin_data_input.VerifyPinDataInput",
    ) -> dict[str, Any]:
        import capo_payment_cryptography_data.types.verify_pin_data_input

        return capo_payment_cryptography_data.types.verify_pin_data_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("VerifyPinData", redact_input=_redact_input),
    )
    input_: capo_payment_cryptography_data.types.verify_pin_data_input.VerifyPinDataInput = {
        "verification_key_identifier": verification_key_identifier,
        "encryption_key_identifier": encryption_key_identifier,
        "verification_attributes": verification_attributes,
        "encrypted_pin_block": encrypted_pin_block,
        "pin_block_format": pin_block_format,
    }
    if primary_account_number is not None:
        input_["primary_account_number"] = primary_account_number
    if pin_data_length is not None:
        input_["pin_data_length"] = pin_data_length
    if dukpt_attributes is not None:
        input_["dukpt_attributes"] = dukpt_attributes
    if encryption_wrapped_key is not None:
        input_["encryption_wrapped_key"] = encryption_wrapped_key

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output