2-pass key transport
This key transport typically installs a Terminal Master Key (TMK) at the Key Receiving Device (KRD). '2-pass' indicates that the KRD is expected to be online for the initial part of the protocol where a random number token is requested. If the KRD is expected to be offline, the '1-pass' protocol may be more appropriate.
Another name for the key is the TR-31 wrapping key name: Key Block Protection Key (KBPK). These represent the same key, a key-encrypting key (KEK), that is shared by the KDH and KRD so that more keys can be shared without going through the entire TR-34 protocol again. However, the type of key transported can be any type of key supported by the TR-31 key block that is carried in the TR-34 protocol token. For this flow, the assumption is that a typical KEK is being exchanged.
Setup steps for key transport
- Refresh CRL-CA if needed:
If CRL-CA held by the KDH, representing that the CA shared between the KRD and KDH is not fresh any longer, the KDH should obtain a new CRL-CA before doing the next step.
- Create TMK/KBPK: The KEK to be shared with the other party.
CCA has restrictions on the type of key that can be used to wrap another key for TR-31 export (the CSNBT31X wrap_kek_identier). Therefore, one of these key types should be generated for exchange:
- DES:
-
- KDH-Wrapping-KEK:
- This is an known or random value EXPORTER KEK created using the TKE workstation or CSNBKPI.
- This key is used with CSNBKGN to create the KRD-Import-KEK, which must be generated in external form under a KEK according to CSNBKGN processing restrictions.
- KEY STORAGE: Stored in CCA key storage.
- KDH-Export-KEK:
- This is the KDH copy of the TMK key that will be used later to wrap keys being exported to the ATM.
- Type: DES EXPORTER key for wrapping output TR-31 key blocks.
- KEY STORAGE: Stored in CCA key storage.
- KRD-Import-KEK:
- This is the KRD copy of the TMK key that will be used later by the ATM to unwrap TR-31 key blocks for key distribution completion.
- Type: DES IMPORTER or IKEYXLAT key for unwrapping input TR-31 key blocks.
- This is the key (Kn) to be exported using TR-34. Because the key is in a CCA or TR-31 token, the notation (Kn-T) is used.
- KEY STORAGE: Stored in CCA key storage until export.
- CCA services:
- Use the CSNBKTB or CSNBT31C service to create skeleton tokens for the EXPORTER/IMPORTER copies of the key.
- Use the CSNBKGN or CSNBT31C service to generate a new DES key and populate to each token.
- KDH-Wrapping-KEK:
- AES:
-
- KDH-Wrapping-KEK:
- This is an known or random value EXPORTER KEK created using the TKE workstation or CSNBKPI2.
- This key is used with CSNBKGN2 to create the KRD Import KEK, which must be generated in external form under a KEK according to CSNBKGN2 processing restrictions.
- KEY STORAGE: Stored in CCA key storage.
- KDH-Export-KEK:
- This is the KDH copy of the TMK key that is used later to wrap keys being exported to the ATM.
- Type: AES EXPORTER key with usage EXPTT31D for wrapping output TR-31 key blocks.
- KEY STORAGE: Stored in CCA key storage.
- KRD-Import-KEK:
- This is the KRD copy of the TMK key that will be used later by the ATM to unwrap TR-31 key blocks for key distribution completion.
- Type: AES IMPORTER key with usage IMPTT31D for unwrapping input TR-31 key blocks.
- This is the key (Kn) to be exported using TR-34. Since the key is in a CCA or TR-31 token, the notation (Kn-T) is used.
- KEY STORAGE: Stored in CCA key storage until export.
- CCA services:
- Use the CSNBKTB2 or CSNBT31C service to create skeleton tokens for the EXPORTER/IMPORTER copies of the key.
- Use the CSNBKGN2 or CSNBT31C service to generate a new AES key and populate each token. Note that the key strength must be 128 bit if key strength rules are to be followed for PCI PTS HSM compliance and other standards. The maximum TR-34 wrapping key strength is AES 128-bit.
- KDH-Wrapping-KEK:
Protocol steps for key transport
- On KDH
- The KDH TR-34 application requests a random number from the KRD.
- On KRD
- KRD TR-34 application receives the random number request and processes it.
- Overview: Call CCA service CSNBRNGL using the keyword RT-KRD to create the TR-34 token that contains random number that is needed by the KDH.
- INPUT: RN-length: Length of the random number needed.
- OUTPUT: RT-KRD: Random number token.
- KEY STORAGE: Stored in application space or key ring until the TR-34 Key Transport token (KT-KDH) is received that matches this RT-KRD random number.
- Send RT-KRD to KDH. Also, store RT-KRD locally in application space for a later validation step.
- KRD TR-34 application receives the random number request and processes it.
- On KDH
- Create the Key Transport token:
- Overview: Call CCA service CSNDT34D using keyword 2PASSCRE.
- INPUT:
- Kn-T: CCA or
TR-31 key token to be exported to the KRD.
KEY STORAGE: Stored in CCA key storage.
- RT-KRD: Key Receiving Device (KRD) Random Number Token (RT-KRD) received from
KRD.
KEY STORAGE: Stored in application space until this call happens.
- CRL-CA: Certificate Revocation List from CA.
KEY STORAGE: Stored in application space or key ring.
- CredKRD: KRD credential with ID and public key. The public key from this is used to RSA-encipher
the RSA-encrypted part of the key block.
KEY STORAGE: Stored in application space or key ring.
- CredKDH: KDH credential with ID and public key.
KEY STORAGE: Stored in application space or key ring.
- D-kdh: Private key to sign data block.
KEY STORAGE: Stored in CCA key storage.
- KBH inputs: TR-31 KBH for a terminal master key is not actually variable, but a peer-to-peer exchange will have more inputs to describe keys.
- Kn-T: CCA or
TR-31 key token to be exported to the KRD.
- OUTPUT: KT-KDH: Key transport (2-pass) token.
KEY STORAGE: Stored in application space until sent to KRD.
- KDH sends the KT-KDH token to the KRD.
- Create the Key Transport token:
- On KRD
- The KRD receives the KT-KDH token from the KDH and must process it to complete the Key Transport.
- Create key token to hold output TMK (CCA / peer-to-peer step).
- Use CCA service CSNBKTB, CSNBKTB2, or CSNBT31C to create Kn-TS, a skeleton CCA or TR-31 key token appropriate for a importing the TMK/KBPK.
- Process the KT-KDH token received from the KDH.
- Overview: Call CCA service CSNDT34R using keyword 2PASSRCV.
- INPUT:
- KT-KDH: Key transport (2-pass) token received from KDH.
- KEY STORAGE: Stored in application space until processed.
- CredKDH: KDH credential with ID and public key.
- KEY STORAGE: Stored in application space or key ring.
- RT-KRD: Token originally sent by the KRD to the KDH and used now for validation.
- KEY STORAGE: Stored in application space.
- D-krd: The private key matching the public key in CredKRD. D-krd is stored in the KRD (but not
in the HSM). Used to RSA-decipher part of the KT-KDH key block.
- KEY STORAGE: Stored in CCA key storage for peer-to-peer / CCA TR-34.
- KT-KDH: Key transport (2-pass) token received from KDH.
- OUTPUT:
- Kn-T: CCA
or TR-31 key token containing the transported TMK/KBPK.
- KEY STORAGE: Stored in CCA key storage on KRD.
- Kn-T: CCA
or TR-31 key token containing the transported TMK/KBPK.
- On KRD
- key-check value generated and returned to KDH.
- The KRD generates a key-check value (KCV) for Kn-T using CCA service CSNBKYT2 using keywords GENERATE and ENC-ZERO or CMACZERO depending on the key algorithm. KRD sends this to the KDH. There is no special encoding for the KCV.
- key-check value generated and returned to KDH.
- On KDH
- key-check value verified by KDH:
- KDH verifies the KCV against the original Kn-T that was sent for export using TR-34. The CCA service CSNBKYT2´using keywords VERIFY and ENC-ZERO or CMACZERO depending on the key algorithm can be used for this value.
- key-check value verified by KDH: