TranslatePinData - AWS Payment Cryptography Data Plane

TranslatePinData

Translates encrypted PIN block from and to ISO 9564 formats 0,1,3,4. For more information, see Translate PIN data in the AWS Payment Cryptography User Guide.

PIN block translation involves changing a PIN block from one encryption key to another and optionally change its format. PIN block translation occurs entirely within the HSM boundary and PIN data never enters or leaves AWS Payment Cryptography in clear text. The encryption key transformation can be from PEK (Pin Encryption Key) to BDK (Base Derivation Key) for DUKPT or from BDK for DUKPT to PEK.

AWS Payment Cryptography also supports use of dynamic keys and ECDH (Elliptic Curve Diffie-Hellman) based key exchange for this operation.

Dynamic keys allow you to pass a PEK as a TR-31 WrappedKeyBlock. They can be used when key material is frequently rotated, such as during every card transaction, and there is need to avoid importing short-lived keys into AWS Payment Cryptography. To translate PIN block using dynamic keys, the keyARN is the Key Encryption Key (KEK) of the TR-31 wrapped PEK. The incoming wrapped key shall have a key purpose of P0 with a mode of use of B or D. For more information, see Using Dynamic Keys in the AWS Payment Cryptography User Guide.

Using ECDH key exchange, you can receive cardholder selectable PINs into AWS Payment Cryptography. The ECDH derived key protects the incoming PIN block, which is translated to a PEK encrypted PIN block for use within the service. You can also use ECDH for reveal PIN, wherein the service translates the PIN block from PEK to a ECDH derived encryption key. For more information on establishing ECDH derived keys, see the Generating keys in the AWS Payment Cryptography User Guide.

The allowed combinations of PIN block format translations are guided by PCI. It is important to note that not all encrypted PIN block formats (example, format 1) require PAN (Primary Account Number) as input. And as such, PIN block format that requires PAN (example, formats 0,3,4) cannot be translated to a format (format 1) that does not require a PAN for generation.

For information about valid keys for this operation, see Understanding key attributes and Key types for specific data operations in the AWS Payment Cryptography User Guide.

Note

AWS Payment Cryptography currently supports ISO PIN block 4 translation for PIN block built using legacy PAN length. That is, PAN is the right most 12 digits excluding the check digits.

Cross-account use: This operation can't be used across different AWS accounts.

Related operations:

Request Syntax

POST /pindata/translate HTTP/1.1 Content-type: application/json { "EncryptedPinBlock": "string", "IncomingDukptAttributes": { "DukptKeyDerivationType": "string", "DukptKeyVariant": "string", "KeySerialNumber": "string" }, "IncomingKeyIdentifier": "string", "IncomingTranslationAttributes": { ... }, "IncomingWrappedKey": { "KeyCheckValueAlgorithm": "string", "WrappedKeyMaterial": { ... } }, "OutgoingDukptAttributes": { "DukptKeyDerivationType": "string", "DukptKeyVariant": "string", "KeySerialNumber": "string" }, "OutgoingKeyIdentifier": "string", "OutgoingTranslationAttributes": { ... }, "OutgoingWrappedKey": { "KeyCheckValueAlgorithm": "string", "WrappedKeyMaterial": { ... } } }

URI Request Parameters

The request does not use any URI parameters.

Request Body

The request accepts the following data in JSON format.

EncryptedPinBlock

The encrypted PIN block data that AWS Payment Cryptography translates.

Type: String

Length Constraints: Minimum length of 16. Maximum length of 32.

Pattern: (?:[0-9a-fA-F][0-9a-fA-F])+

Required: Yes

IncomingDukptAttributes

The attributes and values to use for incoming DUKPT encryption key for PIN block translation.

Type: DukptDerivationAttributes object

Required: No

IncomingKeyIdentifier

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

For dynamic keys, it is the keyARN of KEK of the TR-31 wrapped PEK. For ECDH, it is the keyARN of the asymmetric ECC key.

Type: String

Length Constraints: Minimum length of 7. Maximum length of 322.

Pattern: arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+

Required: Yes

IncomingTranslationAttributes

The format of the incoming PIN block data for translation within AWS Payment Cryptography.

Type: TranslationIsoFormats object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

IncomingWrappedKey

The WrappedKeyBlock containing the encryption key under which incoming PIN block data is encrypted.

Type: WrappedKey object

Required: No

OutgoingDukptAttributes

The attributes and values to use for outgoing DUKPT encryption key after PIN block translation.

Type: DukptDerivationAttributes object

Required: No

OutgoingKeyIdentifier

The keyARN of the encryption key for encrypting outgoing PIN block data. This key type can be PEK or BDK.

For ECDH, it is the keyARN of the asymmetric ECC key.

Type: String

Length Constraints: Minimum length of 7. Maximum length of 322.

Pattern: arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:(key/[0-9a-zA-Z]{16,64}|alias/[a-zA-Z0-9/_-]+)$|^alias/[a-zA-Z0-9/_-]+

Required: Yes

OutgoingTranslationAttributes

The format of the outgoing PIN block data after translation by AWS Payment Cryptography.

Type: TranslationIsoFormats object

Note: This object is a Union. Only one member of this object can be specified or returned.

Required: Yes

OutgoingWrappedKey

The WrappedKeyBlock containing the encryption key for encrypting outgoing PIN block data.

Type: WrappedKey object

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "KeyArn": "string", "KeyCheckValue": "string", "PinBlock": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

KeyArn

The keyARN of the encryption key that AWS Payment Cryptography uses to encrypt outgoing PIN block data after translation.

Type: String

Length Constraints: Minimum length of 70. Maximum length of 150.

Pattern: arn:aws:payment-cryptography:[a-z]{2}-[a-z]{1,16}-[0-9]+:[0-9]{12}:key/[0-9a-zA-Z]{16,64}

KeyCheckValue

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.

AWS Payment Cryptography computes the KCV according to the CMAC specification.

Type: String

Length Constraints: Minimum length of 4. Maximum length of 16.

Pattern: [0-9a-fA-F]+

PinBlock

The outgoing encrypted PIN block data after translation.

Type: String

Length Constraints: Minimum length of 16. Maximum length of 32.

Pattern: [0-9a-fA-F]+

Errors

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

InternalServerException

The request processing has failed because of an unknown error, exception, or failure.

HTTP Status Code: 500

ResourceNotFoundException

The request was denied due to an invalid resource error.

HTTP Status Code: 404

ThrottlingException

The request was denied due to request throttling.

HTTP Status Code: 429

ValidationException

The request was denied due to an invalid request error.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: