All pages
Powered by GitBook
1 of 1

Loading...

(Preliminary Documentation) Message Structure

Each message type follows a specific structure described below.

Request Message

Request Message Format

Tag
Len
Value / Description
Typ
Req
Default

Notes:

  • Message Reference Number: host can use any value to match responses; device echoes it in responses. Recommended: incrementing counter per request within a session.

The tables below list operation status detail codes grouped by source and code. (Only a representative subset is shown here; see the full document for all codes.)

Grp
Sub
Cde
Meaning
Error Codes
Tag
Len
Value / Description
Typ
Req
Default

This message type is used exclusively for transferring larger blocks of data treated as files. It is valid only after successful invocation of the appropriate file operation commands (for example, , or .

Tag
Len
Value / Description
Typ
Req
Default

Example (Hex)

000000

00

00

02

Requested Operation Failed

000002

00

00

10

Setting up RTC data and time failure

000010

00

00

11

Setting up RTC alarm failure

000011

00

00

12

Key generation failure

000012

00

00

13

Tamper setting is locked, can’t be changed

000013

00

00

14

Tamper setting requires system reset to continue

000014

00

00

15

Tamper status can’t be cleared, failure

000015

00

00

16

Device has been tampered, need attention

000016

00

00

17

Tamper module failed for other cases

000017

00

00

18

Setting WLAN SoftAP password failure

000018

010101

01

01

02

Bad message parameter. The host has sent a message to the device that is not constructed properly.

010102

01

01

09

Device offline, can not process messages. For example, the device returns this detail code when it does not have keys injected or has registered a tamper.

010109

01

01

10

PIN Key Not Mapped.

010110

01

01

13

Feature Not Available

010113

01

01

1E

No Valid Subscription

01011E

02

00

00

Reserved

020000

02

01

00

Reserved

020100

02

01

01

Generic Failure

020101

02

01

02

Bad Message Parameter

020102

02

01

03

Response Payload too big

020103

02

01

07

Internal FW Failure

020107

02

01

0A

Image Failure

02010A

02

01

19

Key does not exist

020119

02

01

1A

Not Secured

02011A

02

01

1B

Passcode validation failed

02011B

02

01

1C

Device is locked

02011C

02

01

1D

Device in Restricted mode

02011D

02

02

00

Reserved

020200

02

03

04

Failed, device state issue, no transaction.

020304

02

03

05

Failed, device state issue, cannot cancel.

020305

02

03

08

Failed, device state, Transaction in Progress.

020308

02

03

0C

Failed, device state, Signature Not allowed

02030C

02

03

0D

Failed, device state, Wrong Transaction State

02030D

02

03

0E

Failed, device state, Invalid PIN Entry State

02030E

02

03

0F

Failed, device state, PIN Entry in Session.

02030F

02

03

11

Failed, device state, Barcode Read in Progress.

020311

02

03

12

Failed, device state, Pass-through command Not Activated.

020314

02

03

14

Failed, device state, UI Settings in Progress.

020314

02

03

15

Failed, device state, Buzzer in Progress

020315

02

03

16

Failed, device state, Low Battery (5% or less)

020316

02

03

18

Request is invalid while card emulation is in progress

020318

02

03

1E

Failed, device state, pass-through mode started

02031E

02

03

1F

Failed, device state, pass-through mode is not started

02031F

02

03

20

Failed, device state, pass-through mode APDU is in progress

020320

02

04

13

Failed, BCR hardware not found.

020413

02

05

01

Invalid TR31parameter

020501

02

05

02

Invalid AES length

020502

02

05

03

Invalid 16-Byte Boundary

020503

02

05

04

Invalid Length in Message

020504

02

05

05

Invalid number of optional KBH

020505

02

05

06

Error in conversion of data type

020506

02

05

07

Invalid KCV algorithm

020506

02

05

08

Invalid KCV length

020508

02

05

09

Invalid Optional KBH ID

020509

02

05

0A

Invalid KBH ID

02050A

02

05

0B

Invalid algorithm used in KBH

02050B

02

05

0C

Invalid KBH usage

02050C

02

05

0D

Invalid KBH length

02050D

02

05

0E

Invalid version ID for key derivation

02050E

02

05

0F

Invalid KBH mode of use

02050F

02

05

10

TR31 engine not installed

020510

02

05

11

Invalid Cryptographic operation

020511

02

05

12

MAC Verification Failed

020512

02

05

13

Error in Decrypting Key data

020513

02

05

14

Error in computing MAC over entire message

020514

02

05

15

Invalid MAC length

020515

02

05

16

KDF Error

020516

02

05

17

Buffer Insufficient

020517

02

05

18

Invalid Storage KPM

020518

02

05

19

Invalid Storage Secure RAM

020519

02

05

1A

Invalid Key ID specified in option block

02051A

02

05

1B

Unsupported Key ID specified in option block

02051B

02

05

1C

Invalid Key ID Relationship

02051C

02

05

1D

Protection Key ID not loaded

02051D

02

05

1E

Invalid Data Tag MagTek Custom option block

02051E

02

05

1F

Invalid Kcv

02051F

02

05

20

Invalid Data

020520

02

05

21

Invalid DUKPT key derivation

020521

02

05

22

Invalid Exportability

020522

02

05

23

Invalid Key Class

020523

02

05

24

Invalid DSN

020524

02

05

25

Invalid Challenge

020525

02

05

26

Key Undeletable

020526

02

05

27

Key not present

020527

02

05

28

Unsupported Keyset ID

020528

02

05

29

KPM Error

020529

02

05

2A

Secure RAM Error

02052A

02

05

2B

Duplicated Key

02052B

02

05

2C

Invalid Key Usage Rule

02052C

02

05

2D

Selftest Key Corrupted

02052D

02

05

2E

Selftest System Key Bitmap Corrupted

02052E

02

05

2F

Selftest System Key Missing

02052F

02

05

30

Selftest System Key Not Loaded

020530

02

05

31

Invalid Key Storage Limit

020531

02

05

32

Duplicated Key set

020532

02

05

33

Key Restriction

020533

02

05

34

Key Transported by Weaker key

020534

02

05

35

Repeat Key Agreement

020535

02

05

36

Security not activated

020536

02

05

37

Selftest key relocated

020537

02

05

38

Invalid Selftest Scanned Versus Saved Bitmap

020538

-

-

-

-

-

One-byte standard API Framework Version, not TLV. Values as in requests/responses.

-

-

-

81

4

Message Information

B

R

/null

(1)

Message Type & Direction:

  • 0x03 = Notification from host to device (Reserved).

  • 0x83 = Notification from device to host.

R

/null

(1)

Reserved, set to 0x00

R

/null

(1)

Notification Source — this byte and Notification Type form the first two bytes of a six-byte Notification ID. Use this byte to look up the Notification Group in Example values:

  • 0x01 = Transaction.

  • 0x09 = Firmware Update.

  • 0x10 = Device.

R

/null

(1)

Notification Type — append to Notification Source to identify specific notification (e.g.,

  • 0x01 = Information Update.

  • 0x02 = Warning.

  • 0x03 = Action Request.

  • 0x04 = Callback.

R

/null

(var)

Reserved

O

82

(4)

Notification Detail Code — combined with Notification Source and Notification Type to form a unique six-byte Notification ID. See for notification-specific detail codes.

B

R

/null

1

Category — e.g., 0x00 = Power/Reset

B

R

/null

1

Reason — e.g., 0x02 = Battery

B

R

/null

1

Reason Detail (Subgroup) — e.g., 0x01 = Power Down Imminent

B

R

/null

1

Reserved, set to 0x00

B

R

83

var

Additional Detail — see notification definition in

O

84

var

Notification Payload — as documented in the notification’s table in

B

O

9E

var

Reserved

B

O

-

-

-

-

One-byte standard API Framework Version, not TLV. Values as in requests/responses.

-

-

-

81

08

Message Information

B

R

/null

(1)

Message Type & Direction:

  • 0x04 = Data file from host to device.

  • 0x84 = Data file from device to host.

B

R

/null

(1)

Message Reference Number — host value to match responses.

B

R

/null

(2)

Command Number that prompted this message (see Command Group 0xD8nn - File Operations).

B

R

/null

(4)

File Type — the file type as defined in .

B

R

84

var

File Payload — as documented in .

B

R

020501

02

05

02

Invalid AES length

020502

02

05

0F

Invalid KBH mode of use

02050F

02

05

12

MAC Verification Failed

020512

02

05

16

KDF Error

020516

02

05

21

Invalid DUKPT key derivation

020521

02

05

2B

Duplicated Key

02052B

-

-

One byte standard Start of Message constant, not in TLV format. 0xAA = Standard start of message byte.

-

-

-

-

-

One-byte standard API Framework Version, not TLV. Values: 0x00 = Pre-production, 0x01 = First production release, 0x02 = Second production release, etc.

-

-

-

81

var

Message Information

B

R

/null

(1)

Message Type & Direction:

  • 0x01 = Request from host to device.

  • 0x81 = Request from device to host (Reserved).

B

R

/null

(1)

Message Reference Number

B

R

/null

(2)

Command ID — fully qualified Command number (Command Group, Command within that group). If the Request Payload contains wrappers, the host should specify the command invoked at the core after wrappers are removed.

B

R

/null

(var)

Reserved

O

84

var

Request Payload — as documented in the message’s Request table in section Commands.

B

R

9E

var

Reserved

B

O

Grp

Sub

Cde

Meaning

Error Codes

00

00

00

Grp

Sub

Cde

Meaning

Error Codes

01

01

01

-

-

One byte standard Start of Message constant, not TLV. 0xAA = Standard start of message byte.

-

-

One byte standard Start of Message constant, not TLV. 0xAA = Standard start of message byte.

AA 00 81 08 84 08 D8 21 00 00 00 01 84 40 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 
11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 
31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

Grp

Sub

Cde

Meaning

Error Codes

02

05

01

Response Message

Response Message Format

Operation Status Detail Codes

General (group 0x00)

The General group 0x00 contains operation status detail codes related to the platform that do not originate from a specific functional module.

Subgroup 0x00 = General

Message Handler (group 0x01)

The Message Handler group 0x01 contains operation status detail codes related to parsing and validating messages.

Subgroup 0x01 = Device issues that prevent Message Processing (e.g., Critical Battery, Pending Reset, System Failure, System Busy).

Request Handler (group 0x02) — representative entries

The Request Handler group 0x02 contains operation status detail codes related to starting actual command requests.

  • Subgroup 0x01 = Data issues (bad, missing, unknown…)

  • Subgroup 0x02 = Security / permission problems

  • Subgroup 0x03 = Device state issues (busy, not permitted, tampered, low battery)

  • Subgroup 0x04 = Device issues (missing hardware or features)

  • Subgroup 0x05 = TR31 Errors

Notification Message

Notification Message Format

Data File Message

Data File Message Format

Data File Message Example

TR31 / Cryptographic related (Request Handler subgroup 0x05) — representative entries

0xD811 - Start Send File to Device (Secured)
0xD821 Start Send File to Device (Unsecured),
S0xD821 - Start Get File from Device

All good / requested operation was successful.

Generic Failure.

-

Invalid TR31 parameter

0x18 = User Interface.

0x05 = Operation Complete).

Notifications.
Notifications
Notifications.
Notifications.
0xD8nn - File Operations
About Files