Command 0xEF01 - Load Key Using TR-31

The host uses this command to load a key into one of several available slots in the device’s secure memory.

Table - Device Key ID / Slot

ID
Label
Description
Load TK

1000

TMPTK

Temporary KBPK

agree

1001

MTK

Master Transport

TMPTK

1002

DEVTK

Device Master

MTK

1003

FINTK

Financial Master

MTK

1021

PRODTK

Production - MagTek Internal Only

DEVTK

1022

MFGTK

MagTek Only Internal/External

DEVTK

1081

MKIFTK

MagTek KIF Financial Keys

FINTK

1101

FREQMK

Factory Request MAC

PRODTK

1102

MREQMK

Mfg Device Request MAC

MFGTK

1111

MFRQMK

Mfg Financial Request MAC

MKIFTK

20xx

DKPTM0-1F

MagTek DUKPT Initial Key

MKIFTK

To inject a specific key in the above table, the corresponding Load TK shall be injected previously.

As shown in the table, MTK injection requires that a TMPTK has been created. See Command 0xF017 - Establish Ephemeral KBPK.

After MTK has been injected successfully, the sequence of injecting other keys is as follows:

1

Establish a secure session (Get Challenge)

The host uses Command 0xE001 - Get Challenge to establish a secure session with the device.

2

Construct TR-31 key block

The host constructs a TR-31 (X9.143) key block for the key it is going to load. (Note that the Load Key must be injected previously.)

3

Construct command request

The host constructs the command request for Command 0xEF01 - Load Key Using TR-31 in the format below.

4

Send the command

The host sends the command request to the device.

5

Device response

The device sends a response in the format below to the host.

Table - Request Data for Command 0xEF01 - Load Key Using TR-31

Tag
Len
Value / Description
Typ
Req
Default

Beginning of any wrappers, at minimum including Request Message

EF01 = Command 0xEF01 - Load Key Using TR-31

84

var

Key Block — This is a populated, secured MIFARE Card Data Type (EMV Contactless Only) Table 53 – MIFARE Card Data Type

B

R

DFDFDF40

var

MIFARE Card Data in ASCII terminated with NULL character

DFDFDF41

var

MIFARE Card Data in Binary (optional)

O

TR-31 Key Block Type.

End of any wrappers, at minimum including Request Message

Table - Response Data for Command 0xEF01 - Load Key Using TR-31

Tag
Len
Value / Description
Typ
Req
Default

Beginning of any wrappers, at minimum including Response Message

EF01 = Command 0xEF01 - Load Key Using TR-31

No parameters.

End of any wrappers, at minimum including Response Message

Table - Request Example

Table - Response Example

Last updated