translate_pin_data
Translate encrypted PIN blocks between ISO/AS2805 formats inside APC HSM for acquirer PIN routing, enforcing PCI PIN compliance while keeping the PIN clear text never exposed.
Instructions
Call this when implementing acquirer PIN routing, verifying a PIN translation flow, or checking whether a given format-to-format translation is legal under PCI PIN. This is the core HSM operation in every acquiring PIN path.
Translates a PIN block between encryption zones inside the APC HSM boundary — the PIN is never exposed in clear text. Compliance rules are enforced:
PAN must not change between incoming and outgoing formats (PCI PIN Req 3-3)
Only legal ISO 9564 format translations are permitted (Req 3-3)
Fixed TDES PIN keys are prohibited since 1 January 2023 (Req 2-2)
Preferred flow: AES DUKPT (Format 4) inbound → ZPK AES (Format 4 or 0) outbound
incoming_translation_attributes examples: ISO Format 4 (AES): {"IsoFormat4": {"PrimaryAccountNumber": "1712345678901234"}} ISO Format 0 (TDES): {"IsoFormat0": {"PrimaryAccountNumber": "1712345678901234"}} AS2805 Format 0: {"As2805Format0": {"PrimaryAccountNumber": "1712345678901234"}}
incoming_dukpt_attributes (when incoming key is a BDK): {"KeySerialNumber": "<10 or 12 byte KSN hex>"}
incoming_as2805_attributes (when incoming block uses AS2805 format): {"SessionKeyDerivationAttributes": {...}}
incoming_wrapped_key / outgoing_wrapped_key (dynamic key — TR-31 block passed directly): {"WrappedKeyMaterial": {"Tr31KeyBlock": ""}, "KeyCheckValueAlgorithm": "CMAC"}
Args: incoming_key_identifier: ARN or alias of inbound PEK or BDK (or KEK for wrapped key) outgoing_key_identifier: ARN or alias of outbound PEK or BDK (or KEK for wrapped key) incoming_translation_attributes: PIN block format and PAN for inbound outgoing_translation_attributes: PIN block format and PAN for outbound encrypted_pin_block: Hex-encoded encrypted PIN block incoming_dukpt_attributes: Required when incoming key is a BDK (DUKPT) outgoing_dukpt_attributes: Required when outgoing key is a BDK (DUKPT) incoming_as2805_attributes: Required when incoming block uses AS2805 format incoming_wrapped_key: Optional TR-31 wrapped incoming PEK outgoing_wrapped_key: Optional TR-31 wrapped outgoing PEK
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| encrypted_pin_block | Yes | ||
| incoming_wrapped_key | No | ||
| outgoing_wrapped_key | No | ||
| incoming_key_identifier | Yes | ||
| outgoing_key_identifier | Yes | ||
| incoming_dukpt_attributes | No | ||
| outgoing_dukpt_attributes | No | ||
| incoming_as2805_attributes | No | ||
| incoming_translation_attributes | Yes | ||
| outgoing_translation_attributes | Yes |