Skip to content

generate_as2805_kek_validation async

generate_as2805_kek_validation(
    key_identifier: KeyArnOrKeyAliasType,
    kek_validation_type: As2805KekValidationType,
    random_key_send_variant_mask: RandomKeySendVariantMask,
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
) -> GenerateAs2805KekValidationOutput

Generates a KekValidationRequest or a KekValidationResponse for node-to-node initialization between payment processing nodes using Australian Standard 2805 (AS2805).

During node-to-node initialization, both communicating nodes must validate that they possess the correct Key Encrypting Keys (KEKs) before proceeding with session key exchange. In AS2805, the sending KEK (KEKs) of one node corresponds to the receiving KEK (KEKr) of its partner node. Each node uses its KEK to encrypt and decrypt session keys exchanged between the nodes. A KEK can be created or imported into Amazon Web Services Payment Cryptography using either the CreateKey or ImportKey operations.

To use GenerateAs2805KekValidation to generate a KEK validation request, set KekValidationType to KekValidationRequest. This operation returns both RandomKeySend (KRs) and RandomKeyReceive (KRr) as response values. The partnering node receives the KRs, uses its KEKr to decrypt it, and generates a KRr which is an inverted value of KRs. The node receiving the KRr validates it against its own KRr generated during KEK validation request outside of Amazon Web Services Payment Cryptography.

You can also use this operation to generate a KEK validation response, by setting KekValidationType to KekValidationResponse and providing the incoming KRs. This operation then calculates a KRr. To learn more about more about node-to-node initialization, see Validation of KEK in the Amazon Web Services Payment Cryptography User Guide.

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.

Parameters:

  • key_identifier (KeyArnOrKeyAliasType) –

    The keyARN of sending KEK that Amazon Web Services Payment Cryptography uses for node-to-node initialization

  • kek_validation_type (As2805KekValidationType) –

    Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.

  • random_key_send_variant_mask (RandomKeySendVariantMask) –

    The key variant to use for generating a random key for KEK validation during node-to-node initialization.

Raises:

Source code in docs_src/capo_payment_cryptography_data/_services/async_payment_cryptography_data.py
async def generate_as2805_kek_validation(
    self,
    key_identifier: "capo_payment_cryptography_data.types.key_arn_or_key_alias_type.KeyArnOrKeyAliasType",
    kek_validation_type: "capo_payment_cryptography_data.types.as2805_kek_validation_type.As2805KekValidationType",
    random_key_send_variant_mask: "capo_payment_cryptography_data.types.random_key_send_variant_mask.RandomKeySendVariantMask",
    *,
    config_overrides: Optional[AsyncPaymentCryptographyDataClientConfig] = None,
) -> "capo_payment_cryptography_data.types.generate_as2805_kek_validation_output.GenerateAs2805KekValidationOutput":
    """<p>Generates a <code>KekValidationRequest</code> or a <code>KekValidationResponse</code> for node-to-node initialization between payment processing nodes using <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.html">Australian Standard 2805 (AS2805)</a>.</p> <p>During node-to-node initialization, both communicating nodes must validate that they possess the correct Key Encrypting Keys (KEKs) before proceeding with session key exchange. In AS2805, the sending KEK (KEKs) of one node corresponds to the receiving KEK (KEKr) of its partner node. Each node uses its KEK to encrypt and decrypt session keys exchanged between the nodes. A KEK can be created or imported into Amazon Web Services Payment Cryptography using either the <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> operations.</p> <p>To use <code>GenerateAs2805KekValidation</code> to generate a KEK validation request, set <code>KekValidationType</code> to <code>KekValidationRequest</code>. This operation returns both <code>RandomKeySend</code> (KRs) and <code>RandomKeyReceive</code> (KRr) as response values. The partnering node receives the KRs, uses its KEKr to decrypt it, and generates a KRr which is an inverted value of KRs. The node receiving the KRr validates it against its own KRr generated during KEK validation request outside of Amazon Web Services Payment Cryptography.</p> <p>You can also use this operation to generate a KEK validation response, by setting <code>KekValidationType</code> to <code>KekValidationResponse</code> and providing the incoming KRs. This operation then calculates a KRr. To learn more about more about node-to-node initialization, see <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/as2805.kekvalidation.html">Validation of KEK</a> in the <i>Amazon Web Services Payment Cryptography User Guide</i>.</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>

    Args:
        key_identifier: <p>The <code>keyARN</code> of sending KEK that Amazon Web Services Payment Cryptography uses for node-to-node initialization</p>
        kek_validation_type: <p>Defines whether to generate a KEK validation request or KEK validation response for node-to-node initialization.</p>
        random_key_send_variant_mask: <p>The key variant to use for generating a random key for KEK validation during node-to-node initialization.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_payment_cryptography_data.types.generate_as2805_kek_validation_input.GenerateAs2805KekValidationInput]",
    ) -> AsyncOperationResponse[
        "capo_payment_cryptography_data.types.generate_as2805_kek_validation_output.GenerateAs2805KekValidationOutput"
    ]:
        import capo_payment_cryptography_data._operations.payment_cryptography_data_plane.generate_as2805_kek_validation

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

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

        return capo_payment_cryptography_data.types.generate_as2805_kek_validation_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_payment_cryptography_data.types.generate_as2805_kek_validation_output.GenerateAs2805KekValidationOutput",
    ) -> dict[str, Any]:
        import capo_payment_cryptography_data.types.generate_as2805_kek_validation_output

        return capo_payment_cryptography_data.types.generate_as2805_kek_validation_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GenerateAs2805KekValidation",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_payment_cryptography_data.types.generate_as2805_kek_validation_input.GenerateAs2805KekValidationInput = {
        "key_identifier": key_identifier,
        "kek_validation_type": kek_validation_type,
        "random_key_send_variant_mask": random_key_send_variant_mask,
    }

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