You are on page 1of 114

EMV Application Architecture and Interface Guide

VeriFone Part Number 22595, Revision A


bqfrp q kbj bd^ k^j

boqkb`fobs

= b`k^fim m^

p b`k^fim m^ k lfq^`fi mm^ J fqirj

uuPP=fkjl

pb`k^fimm^ kl fq^`fimm^Jfqi rj o bqk rl` Jo bsl Jak^e

uuTP=fkjl

bo rq` bqfe`o^

aibfepfobs

vqfor`bp

a^m kfm bi_^jj^od lom a bq^od bqk f

M MM R=`p

SC 5000

SC 5000 EMV Application Architecture and Interface Guide 2002 VeriFone, Inc.
All rights reserved. No part of the contents of this document may be reproduced or transmitted in any form without the written permission of VeriFone, Inc. The information contained in this document is subject to change without notice. Although VeriFone has attempted to ensure the accuracy of the contents of this document, this document may include errors or omissions. The examples and sample programs are for illustration only and may not be suited for your purpose. You should verify the applicability of any example or sample program before placing the software into productive use. This document, including without limitation the examples and software programs, is supplied As-Is. VeriFone, the VeriFone logo, Omni, VeriCentre, Verix, and ZonTalk are registered trademarks of VeriFone. Other brand names or trademarks associated with VeriFones products and services are trademarks of VeriFone, Inc. All other brand names and trademarks appearing in this manual are the property of their respective holders. Comments? Please e-mail all comments in this document to i_Tell_Us_More@VeriFone.com

VeriFone, Inc. 2455 Augustine Drive Santa Clara CA 95054-3002 www.verifone.com VeriFone Part Number 22595, Revision A

CONTENTS
CHAPTER 1 General Interface and Communications Protocol CHAPTER 2 Communication Packets and Commands

Assumptions and Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Receiving a NAK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Unsolicited Packets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 5 6 6 6

Packet Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 General Communication Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Packet 11: PIN Pad Connection Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Packet 12: Select Prompt Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Packet 13: Application Version and Modify Serial Port. . . . . . . . . . . . . . . . . 10 Encrypted PIN Communication Packets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Packet 02: Transfer Master Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Packet 04: Check Master Key. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Packet 08: Select a Master Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Packet Z62: Accept and Encrypt PIN, Display Custom Messages . . . . . . . . 17 Packet 71: Transfer PIN Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Packet 72: Cancel Session Request. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Custom Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Custom Communication Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Packet Z2: Display a String. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Packet Z8: Set/ Reset Idle Prompt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

CHAPTER 3 Magnetic Card Reader Specifications CHAPTER 4 ICC Reader Specifications CHAPTER 5 EMV Services

Packet Q4: Activate/Deactivate the Card Reader . . . . . . . . . . . . . . . . . . . . . . . 25 Packet 81: Card Image Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Packet I02: Wait for ICC Removal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Packet I05: ICC Presence Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Transaction Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Primary EMV Communication Packets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Step-by-Step EMV Communication Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Card Status Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C00: Wait For Card and Select Application . . . . . . . . . . . . . . . . . . . Packet C01: Add Amount, Process AFL, and Authenticate . . . . . . . . . . . . . Packet C02: Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C03: Get Card Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C04: Transaction Complete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C05: Add Amount and Process AFL . . . . . . . . . . . . . . . . . . . . . . . . . Packet C06: Card Data Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C07: Get Card Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34 34 35 36 39 39 41 44 45 47 49 50 52
3

EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

Packet C08: Card Holder Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C09: Processing Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C10: Terminal Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C11: Authenticate Issuer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C12: Process Issuer Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C13: Europay-Specific Tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C14: Get CAPK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C15: Set Default DDOL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C16: Set Default TDOL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C17: Set TACs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C18: Set ROS Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C19: Add TLV to Collxn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C20: Get TLV from Collxn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C21: Update TLV in Collxn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C22: Check Fallback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C23: Clean Transaction Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C24: Get Card Second Certificate . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C25: Write to Script File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C99: Unsolicited Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Packet C3X: Super Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Example Situation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Parameters and Response Fields Lists . . . . . . . . . . . . . . . . . . . . . . . . . .

53 54 56 57 58 59 61 62 64 65 66 67 68 70 72 73 74 75 77 78 79 80

CHAPTER 6 EMV Configuration Tables

EST.DAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MVT.DAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How the Tables are Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Field Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Certificate Serial Number Checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

83 83 85 86 88

CHAPTER 7 Database Services

Database Communication Packets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Database Concepts and Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Packet Response Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 Packet D00: Create Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 Packet D01: Table Info . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Packet D02: Seek Record. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Packet D03: Read Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Packet D04: Add New Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Packet D05: Update Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 Packet D06: Delete Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Packet D07: Delete Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 Packet D08: Get Field from Table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 Packet D09: Put Field into Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

CHAPTER 8 Application Switching Packets CHAPTER 9 Application Switching Packets

Packet P00: Remote Application Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Packet P01: Who are You? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111

EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 1
General Interface and Communications Protocol
The SC 5000 Generic Application Interface is designed to provide functionality and services needed to implement specific application (such as, EMV, PINPad101/201 emulation), as well as other regional applications by providing the following features:

EMV services: Required for a complete EMV financial transaction (application selection, data authentication, restriction processing, risk management, cardholder verification, and so on) Traditional PINPadP101/201 credit and debit services: Required for a magnetic-stripe card-based financial transaction (PIN entry, PIN encryption, mag stripe reading, and so on) ICC read/write services: Required for non-EMV ICC-based transactions (for example, loyalty applications) Database services Application selection and RS-232 set up services Adding user-defined commands for specific country or customer application requirements

The SC 5000 communicates with a master device through an RS-232 connection. The master device can request any of the above services using a defined set of commands the PIN pad interprets. A master device can be a VeriFone terminal, ECR (electronic cash register), or other device that can communicate over the RS-232 port using the defined message protocol and command set.

Assumptions and Dependencies


Polling
Since the SC 5000 RS-232 port can be controlled by several applications and each time an application assumes the control it must initialize the port, some data sent by the master device may be lost. To avoid this the master device can send an ENQ character (0x05) to be answered with an ACK character (0x06) by the PIN pad. This procedure indicates if the PIN pad is ready to acknowledge to a master device request. If no ACK is received from the SC 5000 within the time-out period (default = 15 seconds; see Timeout), the master device must continue to poll before sending the packet. The master device must repeat the polling process by sending an ENQ packet until an ACK is received within the time-out period.
SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

G ENERAL I NTERFACE AND C OMMUNICATIONS P ROTOCOL Assumptions and Dependencies

Receiving a NAK

If during a communication session, either the master device or the PIN pad receives a NAK, it retransmits the previous message and increments a NAK counter for the communication session. If more than three NAKs occur while attempting to transmit the same packet, the sending device (that is, the device that transmitted the three NAKs) sends an EOT and terminates the communication session. During a communication session, the PIN pad or master device times out the expected communication is not received within the specified time-out period This can be configured using packet 13 (see section Packet 13: Application Version and Modify Serial Port). The default time-out value is 15 seconds. In this situation, the SC 5000 sends an EOT to terminate the communication session. In some circumstances the SC 5000 may send a specific report to the master device. In this case, an ENQ character is sent from the SC 5000. If this ENQ is answered with an ACK, the SC 5000 sends the unsolicited packet.

Timeout

Unsolicited Packets

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 2
Communication Packets and Commands Packet Format
There are two options for packet format:

<STX><packet data><ETX>{LRC} <SI><packet data><SO>{LRC}


where,
STX = 0x02 ETX = 0x03 SO = 0x0E LRC = longitudinal redundancy check = XOR of all bytes in the

packet, excluding the first byte (STX or SI)


SI = 0x0F

The SC 5000 EMV application accepts any of these formats for all packets described in the rest of this document. The description for each packet, nevertheless, is compatible with PINPad 101 and PINPad 1000. It is recommended that the master device developer comply with this definitions, as there is no guarantee that other platforms have the same flexibility provided by the SC 5000.

General Communication Packets

The following packets initiated tests or functions between a master device and a PIN pad. These packets are suitable for any key management scheme.

Communication test Select prompt language Application version Modify serial port

Table 1 lists packets used in both MS and DUKPT sessions. Table 1 Packet
11 12 13

Common Packets Description


PIN pad connection test Select prompt language Application version and modify serial port

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS General Communication Packets

Packet 11: PIN Pad Connection Test

This packet is used by the master device to test the connection with the PIN pad. On a good connection, the master device receives an ACK from the PIN pad within one second. Otherwise, the master device must assume that the PIN pad is not properly connected.

NOTE

This packet is ignored during any PIN or data entry session.

Table 2

Packet 11 Format Characteristic


1H 2AN 1H 1H

Data Element
<SI> Packet type <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 11 Shift Out, Value: 0Eh Error Check

Packet 11 Length

MAX: 5 characters MIN: 5 characters

Packet 11 Example
<SI>11<SO>{LRC}

Table 3

Packet 11 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>11<SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS General Communication Packets

Packet 12: Select Prompt Language

The master device uses packet 12 to select the prompt language for the PIN pad. Up to four different languages are supported. Languages can be selected from one of the following single digit codes:

The language ID must be in the range 14. If the ID is out of this range, the PIN pad selects English (ID=1), the default language, as the new prompt language. After the new prompt language is selected, the PIN pad displays the new language for 3 seconds, then falls back to the idle prompt in the selected language.

For example, for Latin American countries the supported languages are English, Spanish, French, and Portuguese. Packet 12 is responsible for setting the preferred language of the master device. Other situations where the language can be changed are:


NOTE

If the preferred language for the EMV card is different than set. If the user selects another language during a type operation (for example, Z62).

This option is not yet defined.

Table 4

Packet 12 Format Characteristic


1H 2AN 1N 1H 1H

Data Element
<SI> Packet type [c] <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 12 Language codes: 1 to 4 Shift Out, Value: 0Eh Error Check

Packet 12 Length

MAX: 6 characters MIN: 6 characters

Packet 12 Example
<SI>122<SO>{LRC}

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS General Communication Packets

Table 5

Packet 12 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>12[c]<SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Prompt language is selected.

Packet 13: Application Version and Modify Serial Port

The master device uses packet 13 to obtain the SC 5000 application version identifier and select the baud rate and data communication parameters. After the new baud rate and other parameters are selected, the PIN pad flashes the new configuration for 3 seconds and then returns to the idle prompt. Table 6 Packet 13 Format Characteristic
1H 2AN 1N

Data Element
<SI> Packet type [b]

Comments
Shift In, Value: 0Fh Value: 13 Baud rate codes:
0 = Return application version 1 = 1200 bps 3 = 4800 bps 5 = 19200 bps 7 = 115200 bps 8 and 9 are accepted for backwards 2 = 2400 bps 4 = 9600 bps 6 = 38400 bps

compatibility [c] 1N If [b] = 17 the data configuration is as follows:


1 = 7 bits, even 2 =2 = 7 bits, odd

parity
3 = 8 bits, no

parity
4 = 8 bits, even

parity
5 = 8 bits, odd

parity

parity <FS> <SO> {LRC} 1AN 1H 1H If an FS (0x1C) character is here the display of new configuration is disabled (optional). Shift Out, Value: 0Eh Error Check

10

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS General Communication Packets

Packet 13 Length

MAX: 8 characters MIN: 6 characters

Packet 13 Example
<SI>130<SO>{LRC} (get app version) <SI>1311<SO>{LRC} (1200 baud, 7 bits, Even parity) <SI>1343<SO>{LRC} (9600 baud, 8 bits, No parity)

Table 7

Response Packet Format Characteristic


1H 2AN 32AN 1H 1H

Data Element
<SI> Packet type [application version string] <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 13 String containing the app version Shift Out, Value: 0Eh Error Check

Packet 13 Length

MAX: 35 characters MIN: 4 characters

Packet 13 Example
<SI>001121<SP>100100100<SO>{LRC}

Table 8

Packet 13 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>13[b][c]<SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs


<SI>13[application version string]<SO>{LRC)

only if [b] = 0
ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Baud rate and data configuration are selected accordingly. If [b] 0.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

11

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Encrypted PIN Communication Packets

The following packets initiate test or functions for Master Key Sessions (MS) and are only suitable for key management when the SC 5000 is configured for Master Session or MS + DUKPT. The SC 5000 rejects these packets sending an <EOT> if the PIN pad is configured for DUKPT. Table 9 Packet
02 04 08 Z62 71

Encrypted PIN Packets Description


Transfer Master Key to the PIN pad Check Master Key Select one of the master keys Accept and encrypt PIN; display custom messages Transfer PIN Block Cancel Session Request

???

12

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Packet 02: Transfer Master Key


NOTE

The master device uses this packet to send a master key to the PIN pad.

To avoid overwriting existing master keys, it is required that Packet 04: Check Master Key is sent to check for valid master keys already present in a designated address prior to sending packet 02. Table 10 Packet 02 Format Characteristic
1H 2AN 1N 16H 1H 1H

Data Element
<SI> Packet type [n] [hhh...hh] <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 02 Master key address:
09

Master key in ASCII Shift Out, Value: 0Eh Error Check

Packet 02 Length

MAX: 22 characters MIN: 22 characters

Packet 02 Example
<SI>0200123456789ABCDEF<SO>{LRC}

This example packet requests that the PIN pad load the master key 0123456789ABCDEF into location 0. Table 11 Packet 02 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>02[n][hhhhhhhhhhhhhhhh]<SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs


<SI>02[n][hhhhhhhhhhhhhhhh]<SO>{LRC}

ACK if LRC and key echo okay NAK if LRC incorrect EOT after 3 NAKs EOT if LRC correct but key echo incorrect

PIN pad saves new master key only on receipt of ACK. EOT terminates entire session. EOT

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

13

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Packet 04: Check Master Key


NOTE

The master device sends packet 04 to check if the PIN pad has a master key stored at a designated master key address. To avoid overwriting existing master keys, it is required that packet 04 is sent to check for valid master keys already present in a designated address prior to sending packet 02. Table 12 Packet 04 Format Characteristic
1H 2AN 1N 1H 1H

Data Element
<SI> Packet type [a] <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 04 Master key address:
09

Shift Out, Value: 0Eh Error Check

Packet 04 Length

MAX: 6 characters MIN: 6 characters

Packet 04 Examples
Request sample packet to check if the master key at address 5 is loaded:
<SI>045<SO>{LRC}

Table 13

Response Packet Format Characteristic


1H 2 N 1AN
A

Data Element
<SI> Packet type [r]

Comments
Shift In, Value: 0Fh Value: 04 Response Code: 0 = No MK at address [a] F = MK present at address [a]

<SO> {LRC}

1H 1H

Shift Out, Value: 0Eh Error Check

Response Packet Length

MAX: 6 characters MIN: 6 characters

Response sample packet if no master key at address 5:


<SI>040<SO>{LRC}

14

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Table 14

Packet 04 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>04[a] <SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

PIN pad checks requested address ([a]).


<SI>04[r]<SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

EOT

Packet 08: Select a Master Key


NOTE

The master device sends packet 08 to the PIN pad to select one of ten possible master keys (09). To request PIN entry, the master device should always send packet 08 before sending the following packets
70 Z60 Z62

The master key address must be in the range 09. If the master key address is out of range, the selected MK is not changed. If the master key address is valid, the SMK is set to the new master key location, regardless if the new location contains a master key.
NOTE

To ensure the presence of a valid master key, send Packet 04: Check Master Key before sending packet 08. Table 15 Packet 08 Format Characteristic
1H 2AN 1N 1A 1H 1H

Data Element
<SI> Packet type [a] [check presence flag] <SO> {LRC}

Comments
Shift In, Value: 0Fh Value: 08 Master key address: 0 9 Optional: C Shift Out, Value: 0Eh Error Check

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

15

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Packet 08 Length

MAX: 7 characters MIN: 6 characters

Packet 08 Example
Sample packet to select master key 7:
<SI>087<SO>{LRC}

Table 16

Response Packet Format Characteristic


1H 2AN 1AN

Data Element
<SI> Packet type [r]

Comments
Shift In, Value: 0Fh Value: 08 Response Code: 0 = No MK at address [a] F = MK present at address [a]

<SO> {LRC}

1H 1H

Shift Out, Value: 0Eh Error Check

Response Packet Length


NOTE

MAX: 6 characters MIN: 6 characters

The response packet is only available if [check presence flag] is set to C.

Response Packet Example


Response Sample Packet if no master key at address 5:
<SI>080<SO>{LRC}

Table 17

Packet 08 Communication Protocol Transmit Direction PIN Pad

Master Device
<SI>08[a] <SO>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

PIN pad makes specified master key ([a]) currently active.


<SI>08[r]<SO>{LRC}

16

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Table 17

Packet 08 Communication Protocol (continued) Transmit Direction PIN Pad

Master Device
ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

EOT

Packet Z62: Accept and Encrypt PIN, Display Custom Messages

Packet Z62 initiates the PIN pad to accept a PIN from a customer, build a PIN block, encrypt it (using single DES Master Session key), and return it to the master device. This packet also allows the master device to specify the length of the PIN and if a null PIN entry is allowed. It displays up to two messages, alternating with each other before PIN entry, and a message after PIN entry. The [message1] and [message2] fields can contain printable ASCII characters only. Control characters (00-1Fh) are ignored by the PIN pad. If the [message] fields are empty, they are also ignored by the PIN pad.

NOTE

During a Z62 session, only the receipt of packet 72 from the master device or pressing the CLEAR key ( ) on the PIN pad can cancel the session. On receipt of packet 72, the PIN pad sends EOT to terminate the session and displays CANCEL REQUESTED for 2 seconds (if turned on, otherwise returns to idle prompt). All other packets received during a 70 session are ignored (no response). When the CLEAR ( ) key on the PIN pad, the PIN pad stops the operation and sends EOT to master device to terminate the session, even if a PIN entry was started. If THE CANCEL REQUESTED prompt is enabled (through packet 72), the PIN pad displays the text for 2 seconds, then returns to the idle prompt. If the CANCEL REQUESTED is disabled, the idle prompt displays. To correct any entry from the keypad, use the BACKSPACE () key. Table 18 Packet Z62 Format Characteristic
1H 3AN 1A 8-19N 1H

Data Element
<STX> Packet type Packet Type Del. [aaa...aa] Field Separator

Comments
Start of Text, Value: 02h Value: Z62 Value: (.), 2Eh Card Account Number Value: 1Ch

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

17

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Table 18

Packet Z62 Format (continued) Characteristic


16H

Data Element
[www...ww]

Comments
The working key is encrypted under the PIN pad master key. If zero filled, PIN pad active master key is used as the working key.

[||] [hh] [n]

2N 2N 1
A

Minimum PIN length: 01 16 Maximum PIN length: 01 16 Null PIN status


Y = Null PIN OK N = No null PIN

[bbb...bb] Field Separator [ccc...cc] Field Separator [ddd...dd] Field Separator <ETX> {LRC}

0-16AN 1H 0-16AN 1H 0-16AN 1H 1H 1H

Message 1 (Message 1 and 2 will be displayed until the user presses a key) Value: 1Ch Message 2 Value: 1Ch Processing message to display after PIN entry Value: 1Ch End of Text, Value: 03h Error Check

Packet Z62 Length

MAX: 98 characters MIN: 37 characters

Packet Z62 Example 1


<STX>Z62.4000000000006<FS>0123456789ABCDEF0412YMESSAGE 1 <FS>MESSAGE 2<FS>PROCESSING MSG<ETX>{LRC}

On receipt of packet Z62, the PIN pad alternately displays the text for [message 1] and [message 2] until a PIN or null PIN is entered. A null PIN is generated by pressing the Enter key ( ). Only a PIN with a length range of 4 to 12 digits is accepted. Each PIN digit is echoed with an asterisk (*). As soon as the PIN entry is complete, a third message, PROCESSING MSG, displays.

Packet Z62 Example 2


<STX>Z62.4000000000006<FS>0123456789ABCDEF0608NMESSAGE 1<FS><FS> PROCESSING MSG<ETX>{LRC}

18

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

On receipt of packet Z62, the PIN pad displays the text for [message 1] and [message 2] until a PIN is entered. No null PIN entry is allowed. Only a PIN with a length range of 6 to 8 digits is accepted. Each PIN digit is echoed with an asterisk (*). As soon as the PIN entry is complete, a third message, PROCESSING MSG, displays.

Packet 71: Transfer PIN Block

In response to the request for a PIN (packets 70, Z60, and Z62), the PIN pad encrypts the formatted clear-text PIN block and sends the cipher text PIN block to the master device (refer to VISA PIN Processing Specification, US Version 1.0). Table 19 Packet 71 Format Characteristic
1H 2AN 1A 1N 2N 2N

Data Element
<STX> Packet type Packet delimiter Function Key Indicator PIN Length PIN Block Format

Comments
Start of Text, Value: 02h Value: 71 Value: (.), 2Eh Value is 0, Function key feature not implemented Range: 00, 04 12 Value: 01 Format of PIN block prior to encryption.

PIN Block

16AN

64-bit encrypted PIN block represented as 16 hex digits. Length is 0 if null PIN entered. End of Text, Value: 03h Error Check

<ETX> {LRC}

1H 1H

Packet 71 Length

MAX: 27 characters MIN: 11 characters

Packet 71 Examples
<STX>71.000010123456789123456<ETX>{LRC} <STX>71.00001<ETX>{LRC} <-- NULL entry

Table 20

Packet 71 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>Z62.[aaaaaaaaaaaaaaaaaaa]<FS> [wwwwwwwwwwwwwwww][ll][hh][n] [bbbbbbbbbbbbbbbb]<FS>[cccccccccccccc] <FS>[ddddddddddddddd]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

19

C OMMUNICATION P ACKETS AND C OMMANDS Encrypted PIN Communication Packets

Table 20

Packet 71 Communication Protocol (continued) Transmit Direction PIN Pad


Cycles through these messages:
[bbbbbbbbbbbbbbbb] [cccccccccccccccc]

Master Device

User enters PIN; * display


<STX>71.[f][pp]01 [pppppppppppppppp] <ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Display
[dddddddddddddddd]

repeatedly

Packet 72: Cancel Session Request

Packet 72 is the only packet which can be used to cancel or abort the session after initiating PIN entry mode (packets 70, Z60, and Z62). After the PIN pad receives packet 72, EOT will be sent back to terminate the session. If packet 72 is received and the PIN pad is not in the PIN/data entry mode, ACK will be sent back as in normal condition. All other packets will be ignored (no response) when received during pin/data entry session. Packet 72 returns the PIN-Pad's display to the default idle prompt (set by Z8). Table 21 Packet 72 Format Characteristic
1H 2AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: 72 End of Text, Value: 03h Error Check

Packet 72 Length

MAX: 5 characters MIN: 5 characters

Packet 72 Examples
<STX>72<ETX>{LRC}

Table 22

Packet 72 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>72<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

20

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Custom Specifications

Custom Specifications

The master device must be able to send to the PIN pad special prompts and data entry requirements for customizing the PIN pad. Under control of the master device, the PIN pad can:

Custom Communication Packets

display a single message, display rotating messages (in approximately 3 second intervals), and request a single keystroke entry from the customer.

The following custom packets were designed according to specific application requirements: Table 23 Packet
Z2 Z8

Custom Communication Packets Description


Display a string Set/reset idle prompt

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

21

C OMMUNICATION P ACKETS AND C OMMANDS Custom Specifications

Packet Z2: Display a String

This packet presents messages to the PIN pad display (up to 32 bytes). These messages can only consist of ASCII printable characters. Control characters (00-1Fh) are ignored. Table 24 Packet Z2 Format Characteristic
1H 2AN 1H 0-32AN 1H 1H

Data Element
<STX> Packet type <SUB> [sss...ss] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: Z2 1Ah, Optional (clear display) Message: ASCII string End of Text, Value: 03h Error Check

Packet Z2 Length

MAX: 38 characters MIN: 6 characters

Packet Z2 Examples
<STX>Z2THX<ETX>{LRC}

Directs the PIN pad to add the message THX to the end of the currently displayed message.
<STX>Z2<SUB>PLZ SLIDE CARD<ETX>{LRC}

Directs the PIN pad to clear the current display, then display the message PLZ SLIDE CARD. Table 25 Packet Z2 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>Z2<SUB>[sssssssssssssss]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Clear display. Displays


[ssssssssssssss]

22

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

C OMMUNICATION P ACKETS AND C OMMANDS Custom Specifications

Packet Z8: Set/ Reset Idle Prompt

Packet Z8 sets the idle prompt in the PIN pad. Sending a null string resets the idle prompt to the default setting. Table 26 Packet Z8 Format Characteristic
1H 2AN 0-32AN 1H 1H

Data Element
<STX> Packet type [ppp...pp] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: Z8 Message: ASCII string End of Text, Value: 03h Error Check

Packet Z8 Length

MAX: 37 characters MIN: 5 characters

Packet Z8 Examples
Reset the idle prompt:
<STX>Z8<ETX>{LRC}

Set the idle prompt to NEW PROMPT:


<STX>Z8NEW PROMPT<ETX>{LRC}

Table 27

Packet Z8 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>Z8[pppppppppppppppp]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Idle prompt changed to:


[pppppppppppppppp]

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

23

C OMMUNICATION P ACKETS AND C OMMANDS Custom Specifications

24

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 3
Magnetic Card Reader Specifications
The SC 5000 magnetic (mag) card reader allows customers to slide mag stripe cards to enter account information without ever releasing their card. Table 28 Packet
Q4 81

Magnetic Card Reader Communication Packets Description


Activate/deactivate the card reader Card image response

Packet Q4: Activate/ Deactivate the Card Reader


NOTE

On power up, the PIN pad mag card reader defaults to the disabled state. The master device can use packet Q4 to toggle the PIN pad card reader between its enabled/disabled state. Packet Q4 tells the PIN pad to allow or not allow data entry from its cardreader.

This message does not affect the PIN pad display.

Table 29

Packet Q4 Format Characteristic


1H 2AN 1A

Data Element
<STX> Packet type Card reader status

Comments
Start of Text, Value: 02h Value: Q4 Range:
0 = Activate 1 = Deactivate

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Packet Q4 Length

MAX: 6 characters MIN: 6 characters

Packet Q4 Examples
Activates the PIN pad mag card reader:
<STX>Q40<ETX>{LRC}

Deactivates the PIN pad card reader:


<STX>Q41<ETX>{LRC} SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

25

M AGNETIC C ARD R EADER S PECIFICATIONS

Table 30

Packet Q4 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>Q4[f]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Activate/deactivate card reader.

Packet 81: Card Image Response

Packet 81 sends the card information obtained from the PIN pad card reader to the master device. The track data order in Table 31 was adopted for compatibility with existing applications. Table 31 Packet 81 Format Characteristic
1H 2AN 1A 0-40N

Data Element
<STX> Packet type Message type delimiter [track2 data]

Comments
Start of Text, Value: 02h Value: 81 Value: (.),2Eh Card image information (track 2) or * (0x2A), meaning that an ICC card was inserted. Value: 1Ch Card image information (track 1) Value: 1Ch Card image information (track 3) End of Text, Value: 03h Error Check

Field Separator [track1 data] Field Separator [track3 data] <ETX> {LRC}

1H 0-79AN 1H 0-107N 1H 1H

Packet 81 Length

MAX: 127 characters MIN: 8 characters

PAcket 81 Example
<STX>81.0123456789012345678901234567890123456789<FS><FS><FS><ETX>{LRC}

Table 32

Packet 81 Communication Protocol Transmit Direction PIN Pad


Card swipe

Master Device

26

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

M AGNETIC C ARD R EADER S PECIFICATIONS

Table 32

Packet 81 Communication Protocol Transmit Direction PIN Pad


<STX>81.[track 2]<FS>[track 1]<FS> [track 3]<FS> <ETX>{LRC}

Master Device

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

To optimize the communication between the master device and the PIN pad, packet 81 has the capability to signal that an ICC card was inserted to the primary ICC reader. In this case the response is:
<STX>81.*<ETX>{LRC}

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

27

M AGNETIC C ARD R EADER S PECIFICATIONS

28

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 4
ICC Reader Specifications
The SC 5000 ICC reader allows customers to insert smart cards and perform read/write and security functions associated with the card Table 33 Packet
I02 I05

ICC Reader Communication Packets Description


Wait for ICC Removal ICC Presence Check

Packet I02: Wait for ICC Removal

Packet 102 makes the SC 5000 wait for removal of the customer ICC from the reader. Packet 102 is only valid for the primary ICC reader. This request can be cancelled at any time with packet 72. Table 34 Packet 102 Format Characteristic
1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: I02 End of Text, Value: 03h Error Check

Packet 102 Length

MAX: 6 characters MIN: 6 characters

Packet 102 Example Packet


<STX>I02<ETX>{LRC}

Table 35

Response Packet Format Characteristic


1H 3AN 1N

Data Element
<STX> Packet type [status]

Comments
Start of Text, Value: 02h Value: I02 Operation status:
0 = Success 1 = Invalid parameter

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

29

ICC R EADER S PECIFICATIONS

Response Packet Length

MAX: 98 characters MIN: 7 characters

Packet 102 Example


<STX>I020

Table 36

Packet 102 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>I02<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Wait for ICC removal.


<STX>I02[status]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet I05: ICC Presence Check

Packet 105 forces the SC 5000 to check for the physical presence of an ICC in one of its readers. Table 37 Packet 105 Format Characteristic
1H 3AN 1N 1H 1H

Data Element
<STX> Packet type [reader] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: I05 Reader number: 0-4 0 = primary End of Text, Value: 03h Error Check

Packet 105 Length

MAX: 7 characters MIN: 7 characters

Packet 105 Example


<STX>I051<ETX>{LRC}

30

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

ICC R EADER S PECIFICATIONS

Table 38 Data Element


<STX> Packet type [result]

Response Packet Format Characteristic


1H 3AN 1N

Comments
Start of Text, Value: 02h Value: I05 Result:
0 = no card inserted 1 = ICC inserted

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Response Packet Length

MAX: 7 characters MIN: 7 characters

Packet 105 Example


<STX>I051<ETX>{LRC}

Table 39

Packet 105 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>I05[reader]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Waits for insertion of ICC.


<STX>I05[result]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect (EOT after 3 NAKs)

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

31

ICC R EADER S PECIFICATIONS

32

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 5
EMV Services
Figure 1 outlines a typical EMV transaction.
ICC INSERTED MS CARD SWIPE

SELECT APPLICATION

FAILED

FALLBACK PROCEDURE READ APPLICATION DATA FROM ICC FAILED

GOOD MS

DATA AUTHENTICATION

STOP

CARD RANGING

AMOUNT ENTRY

PROCESSING RESTRICTIONS

MS TERMINAL RISK MANAGEMENT

EMV TERMINAL RISK MANAGEMENT Y CARDHOLDER VERIFICATION N ONLINE?

TERMINCAL ACTION ANALYSIS

TERMINAL-TO-HOST PROTOCOL

ONLINE?

ISSUER AUTHENTICATION, SCRIPT PROCESSING, AND SECOND CRYPTOGRAM

N TRANSACTION COMPLETED

Figure 1

ICC and Magnetic Card Swipe Transaction Flow Chart


SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

33

EMV S ERVICES Primary EMV Communication Packets

Transaction Tasks

The transaction tasks listed in Figure 1 are summarized as follows:

1 Transaction initialization (not shown in Figure 1). 2 Chip card inserted or magnetic card swiped. 3 Application is selected. 4 Read application data from card. 5 Data authenticated. 6 Fallback procedures enacted. 7 Card ranging. 8 Total transaction amount entered. 9 Processing restrictions checked. 10 EMV or MS terminal risk management assessed. 11 Cardholder verified. 12 Terminal action analysis completed. 13 Card generated first cryptogram. 14 Terminal-to-host protocol verified. 15 Issuer authenticated. 16 Script processed. 17 Card generated second cryptogram. 18 Transaction completed.

Primary EMV Communication Packets

The messages listed in this section are the main commands required to facilitate the transactions described above. The objective of these commands is to minimize the communication steps between the master device and the PIN pad, so each message performs as many steps of the whole transaction as possible: Table 40 Packet
C00 C01 C02 C03 C04 C22 C23 C25

EMV Communication Packets Description


Wait For Card and Select Application Add Amount, Process AFL, and Authenticate Risk Management Get Card Certificate Transaction Complete Check Fall Back Clean Transaction Data Write to Script File

34

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Step-by-Step EMV Communication Packets

In the following table, the transaction tasks are associated with the appropriate communication packet.
Transaction initialization (not shown in

Figure 1)
Chip card inserted or magnetic card

Wait for card and select application (C00). Wait for card and select application (C00). Wait for card and select application (C00). Terminal application, plus add amount, process AFL and authenticate (C01). Add amount, process AFL, and authenticate (C01). Add amount, process AFL, and authenticate (C01). Magnetic Card messages (Q4, 81) Check fallback (C22). Terminal application. Risk management (C02). Risk management (C02). Risk management (C02). Get card certificate (C03). Get card certificate (C03). Terminal application. Terminal application. Transaction complete (C04). Transaction complete (C04/C25). Transaction complete (C04). Transaction complete (C04).

swiped
Select application Amount entry

Read application data from card Data authentication Mag card swipe (MS) Fallback procedures Card ranging Processing restrictions EMV terminal risk management Cardholder verification Terminal action analysis Card generates first cryptogram MS terminal risk management Terminal-to-host protocol Issuer authentication Script processing Second cryptogram Transaction completed

Step-by-Step EMV Communication Packets

In addition to the primary commands listed in Primary EMV Communication Packets, the packets listed in Table 41 enable host-specific or customized services. Most of these are a part or individual steps of the commands listed in Primary EMV Communication Packets. Table 41 Packet
C05 C06 C07 C08 C09 C10 C11 C12

Host-Specific or User-defined Communication Packets Description


Add Amount and Process AFL Card Data Authentication Get Card Config Card Hold Verification Processing Restrictions Terminal Risk Management Authenticate Issuer Process Issuer Script
SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

35

EMV S ERVICES Packet Response Codes

Table 41 Packet
C13 C14 C15 C16 C17 C18 C19 C20 C21 C23 C24

Host-Specific or User-defined Communication Packets Description


MasterCard Europe (Europay) specific tests Get CAPK Set default DDOL Set default TDOL Set TACs Set ROS parameter Add TLV to Collxn Get TLV from Collxn Update TLV in Collxn Clean transaction data Get card second certificate

The following table associates tasks with the appropriate communication packet.
Transaction initialization (not

Wait for card and select application (C00) Wait for card and select application (C00) Wait for card and select application (C00) Terminal application, plus add amount and process AFL (C05) Add amount and process AFL (C05) Card data authentication (C06) Magnetic card messages (Q4, 81) Check fallback (C22) Terminal application Process restrictions (C09) Terminal risk management (C10) Cardholder verification (C08) Terminal application Get card certificate (C03) Terminal application Terminal application Authenticate issuer (C11) Process issuer scripts (C12/C25) Get card second certificate (C24)

shown in Figure 1)
ICC inserted Select application Amount entry Read application data from card Data authentication MS card swiped Fallback procedures Card ranging Processing restrictions EMV terminal risk management Cardholder verification Terminal action analysis Card generates first cryptogram MS terminal risk management Terminal-to-host protocol Issuer authentication Script processing Second cryptogram Transaction completed

Packet Response Codes

All C XX response packets contain a 2-digit response code (after the CXX identification) that reflects the result of the operation related to the packet. Table 42 lists these codes.

36

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Packet Response Codes

Table 42 Response Code


00 01 02 03

Packet Response Codes Description


Operation successful Invalid command code Invalid data format Response has more packets Packet ID (CXX) not recognized. One or more parameters are invalid. The resultant packet has more than 512 bytes. The remaining contents will be immediately sent in an additional packet. Some mandatory step for the required task was not performed.

Comments

04

Previous step missing

05 06 07 08 09 10 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42

INVALID_CONFIG TIMEOUT TIMER_ERROR CANCELLED COMM_FAILURE CHIP_RDR_FAILURE USE_CHIP_READER USE_MAG_STRIPE CHIP_ERROR CARD_REMOVED CARD_BLOCKED CARD_NOT_SUPPORTED INVALID_APP DO_ABSENT DO_REPEAT INVALID_PIN PIN_LAST_CHANCE PIN_RETRYLIMIT TLVCOLLECTION_FULL TLVFORMAT INVALID_PDOL INVALID_CDOL INVALID_TDOL INVALID_DDOL INVALID_SDOL AID_LIST_FULL PSE_NOT_FOUND ICC_DATA_MISSING CANDIDATELIST_EMPTY
SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

37

EMV S ERVICES Packet Response Codes

Table 42 Response Code


43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 97 98 99 38

Packet Response Codes (continued) Description


APDU_FORMAT HASH_FAILED BAD_TRACK2 CERTIFICATE_EXPIRED DIFF_AVN_ERR SERVICE_NOT_ALLOWED APP_NOTYET_EFFECTIVE APP_EXPIRED LOWER_LMT_EXCEED UPPER_LMT_EXCEED CVM_FAILED UNRECOGNIZED_CVM BAD_DATA_FORMAT BAD_HASHALGO BAD_IPKALGO INVALID_LENGTH TAG_NOTFOUND INVALID_OFFSET BAD_COMMAND TAG_ALREADY_PRESENT READ_RECORD_FAILED EXPLICIT_SELEC_REQD COND_NOT_SATISFIED CSN_FAILURE BAD_SLOT BAD_LEN NO_MEM CAPK_ERROR PIN_CONFIG_ERR EST_TAB_ERR MVT_TAB_ERR SCRIPT_ERROR LOG_ERROR COMBINED_DDA_AC_GEN_REQD COMBINED_DDA_AC_GEN_FAILED CARD_INSERTED UNRECOG_RETURN UNEXPECTED_RETURN FAIL

Comments

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Some return codes are not expected to be received under normal conditions (for example, 97 and 98). It is possible that these packets may be sent in any unpredictable situation. In this case, a negative number can follow the response code. Report negative-number response codes when requiring support from the VeriFone Helpdesk.

Card Status Detection

ICC insertion and removal events are signaled by the SC 5000 EMV application to the master device. To allow this, unsolicited packets must be enabled through EMVG_DNF.DAT. It is also possible to display CARD INSERTED or CARD REMOVED, according to the event, if configured in the MVT.DAT table. If these features are enabled, C00 begins card status detection. If the card is inserted before issuing C00, the event is not detected. After the card is removed or C23 is issued, card status detection is turned off. Unsolicited packets do not substitute any CXX response, so receipt of C99 and then a CXX answer is normal (see Packet C99: Unsolicited Packet).

Packet C00: Wait For Card and Select Application

This command takes the internal data base configuration data from the SC 5000, which is not specific to any particular card, and puts it in the data object collection (DOC). It also obtains the date and time and puts them in the DOC. This command must be called at the start of every transaction. This command also checks for ICC presence and establishes communication with an EMV card. The C00 command:

Switches the card on, attempts to read the ATR, and decides whether to use the T=0 or T=1 protocol. It sets the appropriate parameters required for terminal-to-card communication, and tests the ATR for conformance with the EMV 96, 3.1.1, Card Spec., Part I, 4. Looks for a PSE file on the card. If found, it makes the selection according to implicit selection rules. Otherwise, it uses explicit selection (EMV 96, ICC Spec., Part III). C00 uses the list of supported applications present in the SC 5000 internal data base. Performs application selection. Packet C00 Format Characteristic
1H 3AN 3N 2N 6N 6N

Table 43

Data Element
<STX> Packet type [timeout] Terminal Record Date Time

Comments
Start of Text, Value: 02h Value: C00 Time to wait for card insertion in seconds Terminal DB record number to be used. Current date in YYMMDD format. Current time in HHMMSS format

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

39

EMV S ERVICES Card Status Detection

Table 43

Packet C00 Format (continued) Characteristic


1H 1H

Data Element
<ETX> {LRC}

Comments
End of Text, Value: 03h Error Check

Packet C00 Length

MAX: 23 characters MIN: 23 characters

Packet C00 Example


<STX>C0000301020325120000<ETX>{LRC}

Table 44

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN) 3N nH (2nAN) 3N nH (2nAN) 1H 1H

Data Element
<STX> Packet type [response] [AID len] [AID] [Pref Name len] [Pref Name] [App Label len] [App Label] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C00 According to Table 42 Tag 4F length (= n) Tag 4F (ASCII representation of hex) Tag 9F12 length (= n) Tag 9F12 (ASCII representation of hex) Tag 50 length (= n) Tag 50 (ASCII representation of hex) End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the tag length MIN: 17 characters

Response Packet Example


<STX>C0000[Data]<ETX>{LRC}

Table 45

Packet C00 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C00[timeout][term rec][date][time]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments.

40

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 45

Packet C00 Communication Protocol (continued) Transmit Direction PIN Pad


<STX>C00[response][data]<ETX>{LRC}

Master Device

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C01: Add Amount, Process AFL, and Authenticate

The C01 command:

Adds the transaction amounts authorized and cash back TLV data objects to the DOC. Tries to initialize the application selected at C00. In case of failure, C01 allows the user to select another application (if available). In this case, the three C00 return fields are replaced by three new fields at C01 response. If the initialized application is the one selected at C00, the first three C01 fields return empty. Performs get processing options and obtains the AFL and other data objects, which are placed in the DOC. If the selected application is Easy Entry (as defined in VIS 1.3), the Easy Entry condition value returns. Takes the AFL from the DOC and uses it to locate files associated with the selected card application. C01 reads all appropriate records from these files, extracts the data, and places it in the DOC. C01 then counts the mandatory data objects and ensures that a data object does not occur more than once. Builds up the concatenated static data required for static data authentication (SDA), as appropriate. (See EMV 96, Application Spec., 7.2.) Takes the relevant cryptographic data from the DOC and uses it to perform either SDA or dynamic data authentication (DDA), as required (according to EMV 96, ICC spec., Part IV, 1. & 2). And takes the relevant CA public key from the appropriate config file described in the Appendix. Checks the issuer public key certificate serial number against a list of revoked serial numbers maintained in the internal data base. It adjusts the values of the TVR and TSI in the DOC as appropriate. If the card does not support SDA or DDA, C01 returns SUCCESS and does nothing. Packet C01 Format Characteristic
1H 3AN 1N 12N

Table 46

Data Element
<STX> Packet type [transaction type] [amount]

Comments
Start of Text, Value: 02h Value: C01 0 = credit 1 = debit Transaction amount (maximum 12 digits)

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

41

EMV S ERVICES Card Status Detection

Table 46

Packet C01 Format Characteristic


12N 4N 1H 1H

Data Element
[cash back amount] [currency code] <ETX> {LRC}

Comments
Transaction cash back amount (maximum 12 digits) Optional. Substitutes Tag 5F2A at the collection. End of Text, Value: 03h Error Check

Packet C01 Length

MAX: 35 characters MIN: 31 characters

Packet C01 Example


<STX>C011000000001000000000000000<ETX>{LRC}

Table 47

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN)

Data Element
<STX> Packet type [response] [AID len] [AID]

Comments
Start of Text, Value: 02h Value: C01 According to Table 42 Tag 4F length (= n) Tag 4F (ASCII representation of hex). This field returns empty if the initialized application is the same as selected in C00.

[Pref Name len] [Pref Name]

3N nH (2nAN)

Tag 9F12 length (= n) Tag 9F12 (ASCII representation of hex). This field returns empty if the initialized application is the same as selected in C00.

[App Label len] [App Label]

3N nH (2nAN)

Tag 50 length (= n) Tag 50 (ASCII representation of hex). This field returns empty if the initialized application is the same as selected in C00.

[Serv Code len] [Serv Code] [CHolder Name len] [CHolder Name] [Track 2 Eq len] [Track 2 Eq] [PAN len] 42

3N nH (2nAN) 3N nH (2nAN) 3N nH (2nAN) 3N

Tag 5F30 length (= n) Tag 5F30 (ASCII representation of hex) Tag 5F20 length (= n) Tag 5F20 (ASCII representation of hex) Tag 57 length (= n) Tag 57 (ASCII representation of hex) Tag 5A length (= n)

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 47

Response Packet Format (continued) Characteristic


nH (2nAN) 3N nH (2nAN) 3N nH (2nAN) 1N

Data Element
[PAN] [Exp Date len] [Exp Date] [PAN Seq len] [PAN Seq] [authentication status]

Comments
Tag 5A (ASCII representation of hex) Tag 5F24 length (= n) Tag 5F24 (ASCII representation of hex) Tag 5F34 length (= n) Tag 5F34 (ASCII representation of hex)
0 = success 1 = CAPK not found 2 = CAPK check sum failure 3 = CAPK check sum absent 4 = SDA failed 5 = DDA failed

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the tag length MIN: 35 characters

Response Packet Example


<STX>C0100[Data]<ETX>{LRC}

Table 48

Packet C01 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C01[tran type][amount][cash back amount]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments.


<STX>C01[response][data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

43

EMV S ERVICES Card Status Detection

Packet C02: Risk Management

Based on the card ranging performed by the terminal application (so that the application knows the issuer and the acquirer), packet C02 collects all configuration data required to perform a particular transaction (in addition data already collected when C00 is sent). It does this by looking through the SC 5000 internal card scheme, general EMV data, and issuer and acquirer tables. Packet C02:

Takes the relevant data from the DOC (which must include the transaction amount) and uses it to perform both the processing restrictions and the terminal risk management procedures (according to EMV 96, Application Spec., 7.4. & 7.6). Adjusts the values of the TVR and TSI in the DOC as appropriate. If the card does not support terminal risk management, this part of the function is not performed and the TRM Performed bit is not set in the TSI. Packet C02 must be called after amount is entered. Takes the relevant data from the DOC (mainly the CVM list) and performs cardholder verification (according to EMV 96, Application Spec., 7.5. & 7.6). Adjusts the values of the TVR and TSI in the DOC as appropriate. If the card does not support cardholder verification, the Cardholder Verification Performed bit is not set in the TSI. Packet C02 Format Characteristic
1H 3AN 4N 4N 1H 1H

Table 49

Data Element
<STX> Packet type [issuer number] [acquirer number] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C02 Issuer index to the internal tables
0 indicates no reference

Acquirer index to the internal tables


0 indicates no reference

End of Text, Value: 03h Error Check

Packet C02 Length

MAX: 14 characters MIN: 14 characters

Packet C02 Example


<STX>C0200010001<ETX>{LRC}

Table 50

Response Packet Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type [response]

Comments
Start of Text, Value: 02h Value: C02 According to Table 42

44

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 50

Response Packet Format (continued) Characteristic


1N

Data Element
[signature flag]

Comments
0 = signature not required 1 = signature required 2 = online PIN required

[TVR len] [TVR] [TSI len] [TSI] <ETX> {LRC}

3N nH (2nAN) 3N nH (2nAN) 1H 1H

Tag 95 length (= n) Tag 95 (ASCII representation of hex) Tag 9B length (= n) Tag 9B (ASCII representation of hex) End of Text, Value: 03h Error Check

Response Packet Length

MAX: 29 characters MIN: 15 characters

Response Packet Example


<STX>C020010050000000000002E800<ETX>{LRC}

Table 51

Packet C02 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C02[issuer number][acquirer number]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments.


<STX>C02[response][signature flag] [TVR][TSI]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C03: Get Card Certificate

Packet C03:

Performs terminal action analysis (see EMV 96, Application Spec., 7.7) to decide what kind of certificate to request. It takes CDOL1 from the DOC, together with the TDOL, where necessary. Can take the default TDOL from the configuration data. Packet C03 uses these data objects to assemble the data string required to perform the generate application cryptogram procedure (according to EMV 96, ICC Spec., Part II, 2.4.5 and EMV 96, Application Spec., 8.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

45

EMV S ERVICES Card Status Detection

Adjusts the values of the TVR and TSI in the DOC, as appropriate. It puts the card-generated 8-byte cryptogram (tag 9F26) in the DOC, along with the cryptogram information data (CID, tag 9F27), the issuer application data (tag 9F10), and the application transaction counter (ATC, tag 9F36). The application must inspect the CID to decide how to proceed with the transaction (see EMV 96, ICC Spec., Part II, 2.4.5.4 & EMV 96, Terminal Spec., Part I, 2.2.7). Packet C03 Format Characteristic
1H 3AN 1N

Table 52

Data Element
<STX> Packet type [terminal decision]

Comments
Start of Text, Value: 02h Value: C03 Enables the application to force the transaction online or force a decline. May be because merchant is suspicious or because application must force a particular transaction online (for example, 1 in N checking). Possible values:
0 = no decision 1 = FORCED_ONLINE 2 = FORCED_DECLINE

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Packet C03 Length

MAX: 7 characters MIN: 7 characters

Packet C03 Example


<STX>C031<ETX>{LRC}

Table 53

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN) 3N nAN 1H 1H

Data Element
<STX> Packet type [response] [CID len] [CID] [Auth Resp len] [Auth Resp] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C03 According to Table 42 Tag 9F27 length (= n) Tag 9F27 (ASCII representation of hex) Tag 8A length (= n) Tag 8A End of Text, Value: 03h Error Check

46

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Response Packet Length

MAX: 20 characters MIN: 20 characters

Response Packet Example


<STX>C0300001800025901<ETX>{LRC}

Table 54

Packet C03 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C03[terminal decision]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments.


<STX>C03[response][CID]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C04: Transaction Complete

Packet C04 takes the data returned by the host after a transaction has gone online and uses the data to perform all necessary steps to complete the transaction (as far as the card is concerned). This always involves performing the second generate AC and can also involve issuer authentication and issuer script processing (EMV 96, Application Spec., 7.9 & 7.10), depending on the data returned by the host and which processes are supported by the card. It adjusts the values of the TVR and TSI in the DOP, as appropriate. The application must inspect the CID to decide how to complete the transaction. It is assumed that all scripts returned by the host will have been written (in binary format) to the files SCRIPT71.DAT (for the type 71 scripts) and SCRIPT72.DAT (for the type 72 scripts). In each file the scripts are simply written sequentially with no separators. Table 55 Packet C04 Format Characteristic
1H 3AN

Data Element
<STX> Packet type

Comments
Start of Text, Value: 02h Value: C04

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

47

EMV S ERVICES Card Status Detection

Table 55

Packet C04 Format (continued) Characteristic


1N

Data Element
[host decision]

Comments
Possible values:
0 = HOST_AUTHORISED 1 = HOST_DECLINED 2 = FAILED_TO_CONNECT 3 = REFERRAL_AUTHORIS 4 = REFERRAL_DECLINE

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Packet C04 Length

MAX: 7 characters MIN: 7 characters

Packet C04 Example


<STX>C042<ETX>{LRC}

Table 56

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN) 3N nAN 2N 5H (10AN) ... 5H (10AN) 1H 1H

Data Element
<STX> Packet type [response] [CID len] [CID] [Auth Resp len] [Auth Resp] [scripts processed] [script 1 results] ... [script n results] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C04 According to Table 42 Tag 9F27 length (= n) Tag 9F27 (ASCII representation of hex) Tag 8A length (= n) Tag 8A Number of scripts processed Results obtained on script 1 processing (ASCII representation of hex) ... Results obtained on script n processing (ASCII representation of hex) End of Text, Value: 03h Error Check

Response Packet Length

MAx: 115 characters MIN: 13 characters

Response Packet Example


<STX>C0400001400211223344551122334455<ETX>{LRC}

48

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 57

Packet C04 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C04[host decision]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C04[response][scripts processed] [script 1 results]...[script n results]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C05: Add Amount and Process AFL

Packet C05:

Adds the transaction amounts, authorized and cash back TLV data objects, to the DOC. Takes the AFL from the DOC and uses it to locate the files associated with the selected card application. Reads all appropriate records from these files, extracts the data, and puts the data in the DOC. Packet C01 then counts the mandatory data objects and ensures that a data object does not occur more than once. Builds up the concatenated static data required for SDA, where appropriate (see EMV 96, Application Spec., 7.2). Packet C05 Format Characteristic
1H 3AN 1N 12N 12N 1H 1H

Table 58

Data Element
<STX> Packet type [transaction type] [amount] [cash back amount] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C05
0 = credit 1 = debit

Transaction amount (maximum 12 digits) Transaction cash back amount (maximum 12 digits) End of Text, Value: 03h Error Check

Packet C05 Length

MAX: 31 characters MIN: 31 characters

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

49

EMV S ERVICES Card Status Detection

Packet C05 Example


<STX>C051000000001234000000000000<ETX>{LRC}

Table 59 Data Element


<STX> Packet type [response] <ETX> {LRC}

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Comments
Start of Text, Value: 02h Value: C05 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C0500<ETX>{LRC}

Table 60

Packet C05 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX> C05[tran type][amount][cash back amount]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C05RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C06: Card Data Authentication

Packet C06:

Takes the relevant cryptographic data from the DOC and uses it to perform either SDA or DDA, as required (according to EMV 96, ICC Spec., Part IV, 1. & 2). Takes the relevant CA public key from the appropriate config. file described in the Appendix. Checks the issuer public key certificate serial number against the list of revoked serial numbers maintained in the internal data base. Adjusts the values of the TVR and TSI in the DOC, as appropriate.


50

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

If the card does not support SDA or DDA this function returns SUCCESS and does nothing. Table 61 Packet C06 Format Characteristic
1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C06 End of Text, Value: 03h Error Check

Packet C06 Length

MAX: 6 characters MIN: 6 characters

Packet C06 Example


<STX>C06<ETX>{LRC}

Table 62

Response Packet Format Characteristic


1H 3AN 2N 1N

Data Element
<STX> Packet type [response] [authentication status]

Comments
Start of Text, Value: 02h Value: C06 According to Table 42
0 = success 1 = CAPK not found 2 = CAPK check sum failure 3 = CAPK check sum absent 4 = SDA failed 5 = DDA failed

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C06000<ETX>{LRC}

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

51

EMV S ERVICES Card Status Detection

Table 63

Packet C06 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C06<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C06RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C07: Get Card Config

Packet C07 collects all configuration data required to perform a particular transaction (in addition to that already collected when C00 is sent) based on the card ranging performed by the terminal application (so that the application knows the issuer and the acquirer). It does this by looking through the SC 5000 internal card scheme, general EMV data, issuer and acquirer tables. Table 64 Packet C07 Format Characteristic
1H 3AN 4N 4N 1H 1H

Data Element
<STX> Packet type [issuer number] [acquirer number] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C07 Issuer index to the internal tables Acquirer index to the internal tables End of Text, Value: 03h Error Check

Packet C07 Length

MAX: 14 characters MIN: 14 characters

Packet C07 Example


<STX>C0700010001<ETX>{LRC}

Table 65

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC} 52

Comments
Start of Text, Value: 02h Value: C07 According to Table 42 End of Text, Value: 03h Error Check

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C0700<ETX>{LRC}

Table 66

Packet C07 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C07[issuer number][acquirer number]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C07RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C08: Card Holder Verification

Packet C08:

Takes the relevant data from the DOC (mainly the CVM list) and performs cardholder verification (according to EMV 96, Application Spec., 7.5. & 7.6). Adjusts the values of the TVR and TSI in the DOC, as appropriate.

If the card does not support cardholder verification, packet C08 returns SUCCESS and does nothing, the Cardholder Verification Performed bit is not set in the TSI. If online PIN verification is required, the online PIN entry function is called. If online PIN is not supported, the pointer to this function should be set to NULL. Table 67 Packet C08 Format Characteristic
1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C08 End of Text, Value: 03h Error Check

Packet C08 Length

MAX: 6 characters MIN: 6 characters

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

53

EMV S ERVICES Card Status Detection

Packet C08 Example


<STX>C08<ETX>{LRC}

Table 68

Response Packet Format Characteristic


1H 3AN 2N 1N

Data Element
<STX> Packet type [response] [signature flag]

Comments
Start of Text, Value: 02h Value: C08 According to Table 42
0 = signature not required 1 = signature required 2 = online PIN required

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Response Packet Length

MAX: 9 characters MIN: 9 characters

Response Packet Example


<STX>C08001<ETX>{LRC}

Table 69

Packet C08 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C08<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C08RR[signature flag]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C09: Processing Restrictions

Packet C09:

Takes relevant data from the DOC and uses it to perform processing restrictions (according to EMV 96, Application Spec., 7.4). Adjusts the value of the TVR in the DOC, as appropriate.

54

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 70

Packet C09 Format Characteristic


1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C09 End of Text, Value: 03h Error Check

Packet C09 Length

MAX: 6 characters MIN: 6 characters

Packet C09 Example


<STX>C09<ETX>{LRC}

Table 71

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C09 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C0900<ETX>{LRC}

Table 72

Packet C09 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C09<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C09RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

55

EMV S ERVICES Card Status Detection

Packet C10: Terminal Risk Management

Packet C10:

Takes relevant data from the DOC and uses it to perform terminal risk management (according to EMV 96, Application Spec., 7.6). Adjusts the values of the TVR and the TSI in the DOC, as appropriate. Must be called after amount is entered. Packet C10 Format Characteristic
1H 3AN 1H 1H

Table 73

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C10 End of Text, Value: 03h Error Check

Packet C10 Length

MAX: 6 characters MIN: 6 characters

Packet C10 Example


<STX>C10<ETX>{LRC}

Table 74

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C10 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1000<ETX>{LRC}

Table 75

Packet C10 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C10<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

56

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 75

Packet C10 Communication Protocol Transmit Direction PIN Pad


SC 5000 performs card treatments
<STX>C10RR<ETX>{LRC}

Master Device

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C11: Authenticate Issuer

Packet C11:

Takes the issuer authentication data the application received from the host after going online and performs issuer authentication (as described in EMV 96, Application Spec. 7.9). Adjusts the values of the TVR and the TSI in the DOC, as appropriate.

If issuer authentication is not supported, the function returns SUCCESS and does nothing. It is assumed that the issuer authentication data (tag 91) is in the DOC. Table 76 Packet C11 Format Characteristic
1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C11 End of Text, Value: 03h Error Check

Packet C11 Length

MAX: 6 characters MIN: 6 characters

Packet C11 Example


<STX>C11<ETX>{LRC}

Table 77

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C11 According to Table 42 End of Text, Value: 03h Error Check

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

57

EMV S ERVICES Card Status Detection

Packet C11 Length

MAX: 8 characters MIN: 8 characters

Packet C11 Example


<STX>C1100<ETX>{LRC}

Table 78

Packet C11 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C11<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C11RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C12: Process Issuer Script


NOTE

Packet C12 takes an issuer script received from the host and sends it to the card (as described in EMV 96, Application Spec. 7.10).

It is the responsibility of the application developer to ensure that the script is sent to the card at the correct point in the transaction (before or after the second generate AC) and that the TVR and TSI are adjusted as appropriate. Table 79 Packet C12 Format Characteristic
1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Script Type] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C12 71 or 72 End of Text, Value: 03h Error Check

Packet C12 Length

MAX: 8 characters MIN: 8 characters

Packet C12 Example


<STX>C1271<ETX>{LRC}

58

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 80

Response Packet Format Characteristic


1H 3AN 2N 2N 5H (10AN) ... 5H (10AN) 1H 1H

Data Elements
<STX> Packet type [response] [scripts processed] [script 1 results] ... [script n results] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C12 According to Table 42 Number of scripts processed Results obtained on script 1 processing (ASCII representation of hex) ... Results obtained on script n processing (ASCII representation of hex) End of Text, Value: 03h Error Check

Response Packet Length

MAX: 110 characters MIN: 10 characters

Response Packet Example


<STX>C12000211223344551122334455<ETX>{LRC}<ETX>{LRC}

Table 81

Packet C12 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C12[script type]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C12RR[scripts processed] [script 1 results]...[script n results]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C13: Europay-Specific Tests

MasterCard Europe (previously known as Europay) mandates requirements for EMV cards in addition to those of the EMV specification. A card whose AID value indicates that it is issued by MasterCard Europe or MasterCard is normally subject to these requirements that is, it is rejected if it does not meet MasterCard Europes requirements, even if it meets all EMV requirements. Packet C13:

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

59

EMV S ERVICES Card Status Detection

Performs all additional card data checks required by MasterCard Europe if the cards AID indicates it is a MasterCard Europe card Tests for additional mandatory data objects. Validates track 2 equivalent data. Compares the second terminal application version number.

Call packet C13 after EMV processing restrictions and terminal risk management. Table 82 Packet C13 Format Characteristic
1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C13 End of Text, Value: 03h Error Check

Packet C13 Length

MAX: 6 characters MIN: 6 characters

Packet C13 Example


<STX>C13<ETX>{LRC}

Table 83

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C13 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1300<ETX>{LRC}

60

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 84

Packet C13 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C13<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C13RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C14: Get CAPK

Packet C14 obtains the appropriate CA public key modulus and exponent required for SDA or DDA. It does this by opening the relevant CAPK configuration file and extracting the key + exponent in binary form. This function must be called if the application is using an SDA or DDA module different from the one provided in the VeriFone Tool Kit. Table 85 Packet C14 Format Characteristic
1H 3AN 5H (10AN) 1H (2AN) 1H 1H

Data Element
<STX> Packet type [RID] [CAPK Index] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C14 Registered application ID (ASCII representation of hex) Certification authority public key index (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C14 Length

MAX: 18 characters MIN:18 characters

Packet C14 Example


<STX> C1400A0000000030C <ETX>{LRC}

Table 86

Response Packet Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type [response]

Comments
Start of Text, Value: 02h Value: C14 According to Table 42

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

61

EMV S ERVICES Card Status Detection

Table 86

Response Packet Format Characteristic


3N nH (2nAN) 2N mH (2mAN) 1H 1H

Data Element
[CAPK Modulus len] CAPK Modulus [CAPK Exponent len] CAPK Exponent <ETX> {LRC}

Comments
CAPK modulus length (= n) CAPK modulus (ASCII representation of hex) CAPK exponent length (= 2m) CAPK exponent (ASCII representation of hex) End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the length of CAPK MIN: 13 characters

Response Packet Example


<STX>C1400040C2CC423911DC4697CC223F7CBBD82C100FF4313C2D0F06941DBEE34A9D51 2FAC7957CB4A03BF16A10103<ETX>{LRC}

Table 87

Packet C14 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C14[RID][CAPK Index]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C14RR<ETX>[CAPK Modulus le][CAPK Modulus][CAPK Exponent len][CAPK Exponent]{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C15: Set Default DDOL

Packet C15 sets the default DDOL directly. This is for situations where the configuration data handling mechanism provided by the EMV Tool Kit is not appropriate. Table 88 Packet C15 Format Characteristic
1H 3AN 3N nH (2nAN)

Data Element
<STX> Packet type [DDOL len] [DDOL] 62

Comments
Start of Text, Value: 02h Value: C15 DDOL length (= n)(= n) DDOL (ASCII representation of hex)

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 88

Packet C15 Format Characteristic


1H 1H

Data Element
<ETX> {LRC}

Comments
End of Text, Value: 03h Error Check

Packet C15 Length

MAX: 513 characters MIN: 9 characters

Packet C15 Example


<STX>C15010AABBCCDDEE<ETX>{LRC}

Table 89

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C15 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1500<ETX>{LRC}

Table 90

Packet C15 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C15[DDOL len][DDOL]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C15RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

63

EMV S ERVICES Card Status Detection

Packet C16: Set Default TDOL

Packet C16 sets the default TDOL directly. This for situations where the configuration data handling mechanism provided by the EMV Tool Kit is not appropriate. Table 91 Packet C16 Format Characteristic
1H 3AN 3N nH (2nAN) 1H 1H

Data Element
<STX> Packet type [TDOL len] [TDOL] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C16 TDOL length (= n)(= n) TDOL (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C16 Length

MAX: 513 characters MIN: 9 characters

Packet C16 Example


<STX>C16010AABBCCDDEE<ETX>{LRC}

Table 92

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C16 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1600<ETX>{LRC}

Table 93

Packet C16 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C16[TDOL len][TDOL]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

64

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 93

Packet C16 Communication Protocol Transmit Direction PIN Pad


SC 5000 performs card treatments
<STX>C16RR<ETX>{LRC}

Master Device

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C17: Set TACs

Packet C17 sets the TACs directly. This is for situations where the configuration data handling mechanism provided by the EMV Tool Kit is not appropriate. Table 94 Packet C17 Format Characteristic
1H 3AN 5H (10AN) 5H (10AN) 5H (10AN) 1H 1H

Data Element
<STX> Packet type [TAC Decline] [TAC Online] [TAC Default] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C17 TAC decline (ASCII representation of hex) TAC online (ASCII representation of hex) TAC default (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C17 Length

MAX: 36 characters MIN: 36 characters

Packet C17 Example


<STX>C17AAAAAAAAAABBBBBBBBBBCCCCCCCCCC<ETX>{LRC}

Table 95

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C17 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters


SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

65

EMV S ERVICES Card Status Detection

Response Packet Example


<STX>C1700<ETX>{LRC}

Table 96

Packet C17 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C17[TAC Decline][TAC Online][TAC Default]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C17RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C18: Set ROS Parameter

Packet C18 sets the parameters for random online selection directly. This is for situations where the configuration data handling mechanism provided by the EMV Tool Kit is not appropriate. Table 97 Packet C18 Format Characteristic
1H 3AN 18N 18N 6N 6N 1H 1H

Data Element
<STX> Packet type [Floor Limit] [RS Threshold] [RS Target] [RS Max] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C18 Floor Limit (in cents) RS Threshold (in cents) RS Target percentage (3 decimals) RS Max percentage (3 decimals) End of Text, Value: 03h Error Check

Packet C18 Length

MAX: 54 characters MIN: 54 characters

Packet C18 Example


<STX>C18000000000000012300000000000000045600050000060000<ETX>{LRC}

Table 98

Response Packet Format Characteristic


1H 3AN

Data Element
<STX> Packet type 66

Comments
Start of Text, Value: 02h Value: C18

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 98

Response Packet Format Characteristic


2N 1H 1H

Data Element
[response] <ETX> {LRC}

Comments
According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1800<ETX>{LRC}

Table 99

Packet C18 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C18[Floor Limit][RS Threshold][RS Target][RS Max]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C18RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C19: Add TLV to Collxn

Packet C19 is required when an application must add a tagged EMV data object in the data object collection (DOC) or to add a new data object to the DOC. Table 100 Packet C19 Format Characteristic
1H 3AN 2H (4AN) 3N nH (2nAN) 1H 1H

Data Element
<STX> Packet type [Tag] [Len] [Data] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C19 Tag name (ASCII representation of hex) Data length (= n)(= n) Data (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C19 Length

MAX: depends on the tag length


SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

67

EMV S ERVICES Card Status Detection

MIN: 15 characters

Packet C19 Example


<STX>C19008E016AABBCCDDEEFFGGHH<ETX>{LRC}

Table 101

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C19 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C1900<ETX>{LRC}

Table 102

Packet C19 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C19[Tag][Len][Data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C19RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C20: Get TLV from Collxn

Packet C20 is required when an application must obtain a tagged EMV data object in the DOC or to add a new data object to the DOC. Since someone may need to retrieve a set of tags, several tags may be required by the same packet. In this case, the response may be bigger than the 512-byte limit for a response packet, and the PIN pad needs to send additional response packets to perform the task. This situation can be recognized by a [response] = 03, indicating additional response packets are being transmitted.

68

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

The response packet(s) contain all tags required in the same order as asked for. If some tags required do not exist in the DOC, their length is set to zero. Table 103 Packet C20 Format Characteristic
1H 3AN 2N 2H (4AN) 2H (4AN) ... 2H (4AN) 1H 1H

Data Element
<STX> Packet type [number of Tags] [Tag 1] [Tag 2] ... [Tag n] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C20 Total tags required (n).
MAX = 10.

First tag required (ASCII representation of hex) Second tag required (ASCII representation of hex) ... nth tag required (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C20 Length

MAX: 50 characters MIN: 12 characters

Packet C20 Example


<STX>C2002008E9F54<ETX>{LRC}

Table 104

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN) 3N nH (2nAN) ... 3N nH (2nAN) 1H 1H

Data Element
<STX> Packet type [response] [Len 1] [Data 1] [Len 2] [Data 2] ... [Len n] [Data n] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C20 According to Table 42 First required tag data length (= n)(= n) First required tag data (ASCII representation of hex) Second required tag data length (= n)(= n) Second required tag data (ASCII representation of hex) ... nth required tag data length (= n)(= n) nth required tag data (ASCII representation of hex) End of Text, Value: 03h Error Check

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

69

EMV S ERVICES Card Status Detection

Response Packet Length

MAX: depends on the tag length MIN: 40 characters

Response Packet Example


<STX>C2000016AABBCCDDEEFFGGHH006AABBCC<ETX>{LRC}

Table 105

Packet C20 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C20[number of Tags][Tag 1]... [Tag n]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C2003[Len 1][Data 1]...<ETX>{LRC}

(optional)
ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs
<STX>C20RR...[Len n][Data n]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C21: Update TLV in Collxn

Packet C21 is required when an application needs to update a tagged EMV data object in the DOC or to add a new data object to the DOC. Table 106 Packet C21 Format Characteristic
1H 3AN 2N 2H (4AN) 3N nH (2nAN) ... 2H (4AN) 3N nH (2nAN)

Data Element
<STX> Packet type [number of Tags] [Tag 1] [Len 1] [Data 1] ... [Tag m] [Len m] [Data m]

Comments
Start of Text, Value: 02h Value: C21 Total tags required (m).
MAX = 10.

Tag name (ASCII representation of hex) Data length (= n) Data (ASCII representation of hex) ... Tag name (ASCII representation of hex) Data length (= n) Data (ASCII representation of hex)

70

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 106

Packet C21 Format Characteristic


1H 1H

Data Element
<ETX> {LRC}

Comments
End of Text, Value: 03h Error Check

Packet C21 Length

MAX: depends on the tag length MIN: 15 characters

Packet C21 Example


<STX>C21008E016AABBCCDDEEFFGGHH<ETX>{LRC}

Table 107

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C21 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C2100<ETX>{LRC}

Table 108

Packet C21 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C21[Tag][Len][Data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C21RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

71

EMV S ERVICES Card Status Detection

Packet C22: Check Fallback

When a magnetic stripe card is read, packet C22 must be issued to verify that the card is EMV and has a chip. This is done through the service code on the stripe. If this is the case, the magnetic stripe transaction is only allowed if the last ICC read failed. This is done internally by the EMV application. The following are possible scenarios:

If does not contain an EMV chip, continue the MS transaction. If it does contain an EMV chip and the last ICC read failed, continue the MS transaction. If it does contain an EMV chip and the last ICC read did not fail, display a message and return the appropriate response code. Packet C22 Format Characteristic
1H 3AN 3N 1H 1H

Table 109

Data Element
<STX> Packet type [service code] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C22 Magnetic stripe service code End of Text, Value: 03h Error Check

Packet C22 Length

MAX: 7 characters MIN: 7 characters

Packet C22 Example


<STX>C22621<ETX>{LRC}

Table 110

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C22 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C2200<ETX>{LRC}

72

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 111

Packet C22 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C22[service code]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C22RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C23: Clean Transaction Data

Packet C23:

Resets all the parameters for that transaction. Cleans all the TLV data objects at the DOC. Packet C23 Format Characteristic
1H 3AN 1H 1H

Table 112

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C23 End of Text, Value: 03h Error Check

Packet C23 Length

MAX: 6 characters MIN: 6 characters

Packet C23 Example


<STX>C23<ETX>{LRC}

Table 113

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C23 According to Table 42 End of Text, Value: 03h Error Check

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

73

EMV S ERVICES Card Status Detection

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C2300<ETX>{LRC}

Table 114

Packet C23 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C23<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C23RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C24: Get Card Second Certificate

Packet C24:

Performs the second generate AC operation. Puts the card-generated 8-byte cryptogram (tag 9F26) in the DOC along with the cryptogram information data (CID, tag 9F27), the issuer application data (tag 9F10,) and the application transaction counter (ATC, tag 9F36).

The application must inspect the CID to decide how to proceed with the transaction (see EMV 96, ICC spec., Part II, 2.4.5.4 & EMV 96, Terminal spec., Part I, 2.2.7). Table 115 Packet C24 Format Characteristic
1H 3AN 1N

Data Element
<STX> Packet type [host decision]

Comments
Start of Text, Value: 02h Value: C24 Host decision. Possible values:
0 = HOST_AUTHORISED 1 = HOST_DECLINED 2 = FAIL_TO_CONNECT 3 = REFERRAL_AUTHORIS 4 = REFERRAL_DECLINE

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

74

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Packet C24 Length

MAX: 7 characters MIN: 7 characters

Packet C24 Example


<STX>C240<ETX>{LRC}

Table 116

Response Packet Format Characteristic


1H 3AN 2N 3N nH (2nAN) 3N nAN 1H 1H

Data Element
<STX> Packet type [response] [CID len] [CID] [Auth Resp len] [Auth Resp] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C24 According to Table 42 Tag 9F27 length (= n) Tag 9F27 (ASCII representation of hex) Tag 8A length (= n) Tag 8A End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C2400<ETX>{LRC}

Table 117

Response Packet Format Transmit Direction PIN Pad

Master Device
<STX>C24[host decision]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C24RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C25: Write to Script File

Packet C25 is required for script processing. It allows the creation of EMVS71.DAT and EMVS72.DAT files adding the scripts received from the host.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

75

EMV S ERVICES Card Status Detection

Scripts of type 71 are to execute before second AC generation, and scripts of type 72 after it. The maximum script size supported by the EMV specs. is 261 bytes. The maximum packet size supported by SC 5000 is 512 bytes. The maximum supported size for the script, according to the format below, is 249 bytes. The solution is to transfer the script in two packets using
[number of scripts] 81 and [number of scripts] 91

The [number of scripts] element is described in Table 118. Note that in this case, only one script can transfer in the two-packet message. Table 118 Packet C25 Format Characteristic
1H 3AN 2N 1N 2N

Data Element
<STX> Packet type [script type] [clear file flag] [number of scripts]

Comments
Start of Text, Value: 02h Value: C25 71 or 72
0 = append script to existing file 1 = clear file before adding the script

Total number of scripts to follow. Special values:


81: The first part of a two-packet message

(for scripts larger than 249 bytes)


91: The second part of a two-packet

message [script 1 length] 3N Script 1 Data length (= n) Transfers in this packet for a two-packet message. [script 1 data] ... [script n length] [script n data] [script length] [script data] <ETX> {LRC} nH (2nAN) ... 3N nH (2nAN) 3N nH (2nAN) 1H 1H Script 1 (ASCII representation of hex) .. Script n data length (= n) Script n data (ASCII representation of hex) Data length (= n) Data (ASCII representation of hex) End of Text, Value: 03h Error Check

Packet C25 Length

MAX: depends on the script length MIN: 16 characters

Packet C25 Example


<STX>C25172010061A2B3C4D5E6F<ETX>{LRC}

76

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Table 119

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C25 According to Table 42 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>C2500<ETX>{LRC}

Table 120

Packet C25 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>C25<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 performs card treatments


<STX>C25RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet C99: Unsolicited Packet

When certain events occur, the SC 5000 EMV application may need to send unsolicited data to the master device. Examples of this are the ICC insertion or removal events. EMV recommendsand some bank specifications requirethat the master device is warned about these events and display appropriate messages. To avoid packet collision, the SC 5000 first sends an ENQ (05h) to the master device, indicating the intention of sending a packet. If the master device answers this request with an ACK (06h), then the SC 5000 sends packet C99, according to the format listed in Table 121. If the master device does not send an ACK or sends a request packet instead, the SC 5000 abandons the process without sending packet C99.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

77

EMV S ERVICES Card Status Detection

Table 121

Packet C99 Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [response] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C99 According to Table 42 End of Text, Value: 03h Error Check

Packet C99 Length

MAX: 8 characters MIN: 8 characters

Packet C99 Example


<STX>C9978<ETX>{LRC}

Table 122

Packet C99 Communication Protocol Transmit Direction PIN Pad


ENQ

Master Device

ACK
<STX>C99RR<ETX>{LRC}

ACK if LRC okay NAK if LRC

incorrect
EOT after 3 NAKs

Packet C3X: Super Command

We have designed this message to obtain the best possible performance in making an EMV transaction. Packet C3X:

Performs the tasks of C01, C02, C03, C04, C20, C21 and C22. This includes all transaction services, obtaining and updating data objects from and to the internal SC 5000 Data Object Collection, and checking for magnetic stripe fall back. Parameters are all binary to prevent the applications from making excessive data conversions. Parameters are TLV objects. If they are direct readings or updates to internal Data Object Collection, the tags will be known EMV tags. If the parameters are proprietary data from the application, the tags will be 0xC1, 0xE1, 0xC2, and 0xE2, as explained below.

78

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

Once called, depending on the parameters provided and the transaction results, it will perform as many activities as possible. In the best case, one issue will be sufficient to perform all the transactions.

The idea is to call C3X, where X can be 0 through 4, in increasing order. The C30 is the first packet to be called. The minimum parameters are the same as for the C00 packet but, if C01, C02, C03 or C04 packets' parameters are already available, It is possible to provide them at C30. Example Situation Let's suppose that, at the beginning of the transaction, you already have the transaction type, the amounts and the currency code involved. This way you can call the C30 with C00 + C01 parameters. The result will be that the EMV application will perform both packets' services and return a C31 response packet containing the response parameters of C00 + C01 packets. If, more than that, you are not performing card ranging (no issuer and acquirer specific data considered) and you already have the merchant decision, you will call C30 and receive a C33 response packet. In the best case, if your terminal has no on-line capability enabled, you already know the host decision: FAILED TO CONNECT. In this case, C30 has a C34 response, completing the transaction with just one packet exchange. Table 123 C3X Parameter Format Characteristic
1H 3AN 2H ?H 1H 1H

Data Element
<STX> Packet type [param list size] [param list] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: C3X X = 1, 2, 3 or 4

size of parameters list in 2 binary bytes list of parameters in TLV format


End of Text, Value: 03h Error Check

Packet C3X Length

MAX: depends on the length of the parameter list MIN: 8 characters C3X Response Format Characteristic
1H 3AN 2N

Table 124

Data Element
<STX> Packet type [response]

Comments
Start of Text, Value: 02h Value: C3X X = 1, 2, 3 or 4

According to Table 42

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

79

EMV S ERVICES Card Status Detection

Table 124

C3X Response Format Characteristic


2H ?H 1H 1H

Data Element
[response fields list size] [response fields list] <ETX> {LRC}

Comments size of response fields list in 2 binary bytes list of response fields in TLV format
End of Text, Value: 03h Error Check

Packet C3X Length

MAX: 8 characters MIN: 16 characters Packet C3X Communication Protocol Transmit Direction PIN Pad

Table 125

Master Device
<STX>C3X<size1><size2> <param list><ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect (EOT after 3 NAKs)

SC 5000 performs card treatments


<STX>C3XRR<size1><size2> <response fields list><ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Parameters and Response Fields Lists As mentioned above, the tag labels may be known EMV ones, if directed related to the Data Object Collection present at the SC 5000. They may can also receive special tag labels if they use proprietary data. The possible proprietary tag labels are:

0xC1 - for input parameters. 0xE1 - for input constructed objects. 0xC2 - for output parameters. 0xE2 - for output constructed objects.

Input - Parameters List

C1<len><timeout>C1<len><terminal record>C1<len><DDMMYY>C1<len><HHMMSS> C1<len><txn type>C1<len><amt>C1<len><amt other>C1<len><curr code> C1<len><issuer record>C1<len><acquirer record>


80
SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV S ERVICES Card Status Detection

C1<len><merchant decision>E1<len><min req obj> C1<len><host decision>E1<len><TLVs from host>


The parameters in the first list item are the minimum for C30 packet, the ones in the second list item are the minimum for C31, and so on. Basically they all match with C01,..., C04 parameters except for min req objects and TLVs from host which matches with the C20 packets, issued to update the data needed to assemble the packet to perform an online transaction and the C21 packets to update the Data Collection with the objects received from the host at an online connection.

Output - Response Fields List:

<4F><len><AID><9F12><len><Application Preferred
Name><50><len><Application Label>

<5F30><len><Service Code><5F20><len><cardholder name><57><len><Track 2


Equivalent Data><5A><len><Application PAN><5F24><len><Expiration Date><5F34><Application PAN Seq. Number><C2><len><Authentication status>

C2<len><Signature Flag><9500><len><TVR><9B><len><TSI> <9F27><len><Crypt. Info. Data><8A><Authorization Response Code> E2<len><Objects Required for an online transaction>
The response fields in the first list item are the minimum returned by C30 packet, the ones in the second list item are the minimum returned by C31, and so on. Basically they all match with C01,..., C04 response fields except for the Objects Required for an online transaction which matches with the C20 packets, issued to obtain the data needed to assemble the packet to perform an online transaction.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

81

EMV S ERVICES Card Status Detection

82

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 6
EMV Configuration Tables
Use the following two tables to configure an EMV transaction:

EST.DAT

Card scheme table, EST.DAT EMV configuration table, MVT.DAT

Name of card scheme Registered application identification 10 AID data sets with:

VISA, MASTERCARD, and so on. RID: for example, A000000003 for VISA Application identification (AID): for example, A0000000031010 Partial name selection flag: Allows or prohibits partial name selection for the AID. Application version number: for example, 8300 Second application version number: for example, 8300 Pointer to a record in MVT.DAT
-1 indicates no reference

MVT.DAT
Card scheme reference
Pointer to a record in EST.DAT that this set of mandated data is for.
-1 indicates non-scheme specific

Issuer reference

Pointer to a record at EST.DAT that this set of mandated data is for.


-1 indicates non-issuer specific.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

83

EMV C ONFIGURATION T ABLES

Term risk management data present flag

Flag required because any one of the following data elements could be set to zero:
Floor limit Random selection threshold Target random selection

percentage
MAX target random selection

percentage
Terminal action code Default Terminal action code Denial Terminal action code Online

Default TDOL Default DDOL Next record reference

Terminal data object list Dynamic data authentication data object list. Used for DDA. This means that there is another record mandated by the same entity but for a different scheme or issuer.
-1 indicates no further records.

EMV Transaction Counter Terminal Country Code Terminal Currency Code Terminal Capabilities Terminal Additional Capabilities Terminal Type Merchant Category Code Auto Select Flag Terminal ID Merchant ID Acquirer ID Terminal CAPK index (tag 9F22
1 enabled 0 disabled

8-digit terminal ID Up to 15 characters of the merchant ID. Up to an 11-digit acquirer ID. This tag that must be provided for some DOLs and has no relation to tag 8F.
1 enabled 0 disabled

PIN bypass flag PIN timeout PIN format

For ICC card or online PIN, time, in seconds, to wait for a PIN entry. For online PIN
0-1 Master Session 2-9 DUKPT B secure scripts

84

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV C ONFIGURATION T ABLES How the Tables are Used

PIN script number

For online PIN


0-7 secure scripts 8 Master Session 9 DUKPT

PIN macro number PIN key derivation flag

For online PIN: if secure scripts are in use. For online PIN
0 = traditional 1 = using script 2 = none

PIN key derivation macro number Card status display flag

For online PIN: If secure scripts are in use.


0 = does not display CARD

INSERTED and CARD REMOVED messages on the SC 5000 when this event occurs and unsolicited packets are configured at EMVG_CNF.DAT
1 = displays the messages.

How the Tables are Used

At EMV application initialization, all records from EST.DAT are read to generate the AID list, obtaining all supported AIDs for all card schemes (records). At transaction initialization when packet C00 is sent by the POS/ECR to the SC 5000, the application reads the MVT.DAT terminal record included in the packet (TR=1 means record=0) as the default-terminal EMV parameters for that transaction. During the risk management phase, packet C02 is sent by the POS/ECR to the SC 5000, including the issuer and acquirer record numbers at MVT.DAT. During packet C02 execution, the following fields of the MVT.DAT terminal record may be overruled:

Floor Limit Random Selection Threshold Target Random Selection Percentage MAX Target Random Selection Percentage Terminal Action Code Default Terminal Action Code Denial Terminal Action Code Online Default TDOL Default DDOL

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

85

EMV C ONFIGURATION T ABLES Field Format

These fields are referenced as ROL (the first 4), TAC (the three terminal action codes), TDOL, and DDOL. This overrule only can happen if the terminal record does not specify values for these fields. Also during the risk management phase, the acquirer identifier (tag 9F01) is replaced if an acquirer record number is defined in package C02.

a Reads EST.DAT until the current RID record is found, and accesses the
exact AID to determine the terminal AVN. Steps b-d are only performed if any of the TAC, ROL, TDOL, and DDOL parameters are not the default value in the terminal record. In this case, only those with no default value receive a value.

b In the same EST.DAT record, checks for a pointer to any MVT.DAT record
that indicates a EMV specific data mandate. If as pointer is found, reads the MVT.DAT record and overwrites the TAC, ROL, TDOL, and DDOL parameters.

c If an issuer record was defined in packet C02 ([rec num] > 0), reads the
MVT.DAT record and checks if the card scheme reference matches the record read in step C. If so and any of the EMV parameters (TAC, ROL, TDOL and DDOL) were not loaded yet then load them. If issuer record was defined, check for the next record reference. If 0, reads this record and check for a match. Continues to scan the table until parameters are loaded or the next record reference = -1 (indicating no reference).

d If an acquirer record was defined in packet C02 ([rec num] > 0), reads
the MVT.DAT record and updates the acquirer identifier (tag 9F01) at object collection. It also checks if the card scheme reference and the issuer reference match with the record read in steps c and d. If so and any EMV parameters (TAC, ROL, TDOL, or DDOL) have not been loaded, then loads them. If not, checks for the next record reference. If 0, reads the record checking for a match. Continues to scan the table until parameters are loaded or the Next Record Reference = -1 (indicating no reference).

Field Format

The following tables are created outside the SC 5000, using the GENDATA utility. Table 126 Field Name
1: Name of card scheme 2: Registered application identification (RID) 3, 7, 10,..., 39: Application identification 4,8,11,...40: Partial name selection flag 5,9,12,...,41: Application version number 6,10,13,...,42: Second application version number 43: Pointer to a record in MVT.DAT

Card Scheme Table: EST.DAT Type


Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string

Size
32 + 1 10 + 1 32 + 1 1+1 4+1 4+1 4+1

86

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

EMV C ONFIGURATION T ABLES Field Format

Table 127 Field Name

EMV Configuration Table: MVT.DAT Type


Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string Null-terminated string

Size
4+1 4+1 1+1 14 + 1 14 + 1 5+1 5+1 10 + 1 10 + 1 10 + 1 64 + 1 64 + 1 4+1 6+1 4+1 4+1 6+1 10 + 1 2+1 4+1 1+1 8+1 15 + 1 11 + 1 2+1 1+1 3+1 1+1 1+1 2+1 1+1 2+1 1+1

1: Card scheme reference 2: Issuer reference 3: Term risk management data present flag 4: Floor limit 5: Random selection threshold 6: Target random selection percentage 7: MAX target random selection percentage 8: Terminal action code: Default 9: Terminal action code: Denial 10: Terminal action code: Online 11: Default TDOL 12: Default DDOL 13: Next record reference 14: EMV transaction counter 15: Terminal country code 16: Terminal currency code 17: Terminal capabilities 18: Terminal additional capabilities 19: Terminal type 20: Merchant category code 21: Auto select flag 22: Terminal ID 23: Merchant ID 24: Acquirer ID 25: Terminal CAPK index (tag 9F22) 26: PIN bypass flag 27: PIN timeout 28: PIN format 29: PIN script number 30: PIN macro number 31: PIN key derivation flag 32: PIN key derivation macro number 33: Card status display flag

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

87

EMV C ONFIGURATION T ABLES Certificate Serial Number Checking

Certificate Serial Number Checking

To provide a mechanism to check for invalid issuer certificate serial numbers, you can download exception files to the SC 5000, with the extension .CSN. Their filenames are <RID>.CSN, for example:
A000000003.CNS

.CSN file are text files and each record contains eight ASCII bytes, as follows:

The two first bytes correspond to two nibbles of CAPK index (for example, 96) The six subsequent bytes correspond to six nibbles (three binary bytes) of the CSN to check

These records are separated by CR/LF.

88

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 7
Database Services
This section presents packets to control database services.

Database Communication Packets

Database communication packets can be used to define application data objects, including downloadable configuration parameters. In addition, applications can be designed to allow data sharing and/or data object passing to other applications on the SC 5000. Once the tables are created outside the SC 5000 and are downloaded into it with the applications, this set of commands is not mandatory and are only necessary if the master device application (ECR/POS) decides to change the initial configuration. Table 128 Packet
D00 D01 D02 D03 D04 D05 D06 D07 D08 D09

Database Communication Packets Description


Create Table Get Table(s) Info Seek Record Read Record Add New Record Update Record Delete Record Delete Table Get field from a Table Put field to a Table

NOTE

Specific database implementation design and packet contents are not within the scope of this document.

Database Concepts and Definitions

SC 5000 database fields are all null-terminated strings. [Record] is sequence of fields (or strings) separated by an FS (field separator, 0x1C) character. [Table IDs] and [Record Numbers] all begin at 1. [Condition] is a comparison criteria between a field and a string value in the following format:
NNNCT<string>

where,
SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

89

D ATABASE S ERVICES Database Communication Packets

NNN = field number C = Comparison

0 (for equal) 1 (for not equal) 2 (for less than) 3 (for less or equal) 4 (for greater than) 5 (for greater or equal)

T = Type 0 (for non-numerical comparison) 1 (for numerical comparison)

[Table Info] is composed of:


<table name><FS><number of records><FS><record size><FS> <number of fields>

Packet Response Codes

All D XX response packets contain a two-digit response code (after the DXX identification) that reflects the result of the operation related to the packet. Table 129 describes these codes. Table 129 Code
00 01 02 03

Database Packet Response Codes Description


Operation successful Invalid command code Invalid data format Response has more packets The packet ID (DXX) is not recognized. One or more parameters are not valid. The resultant packet has more than 512 bytes and the remaining contents are immediately sent in an additional packet.

Comments

04 05 06 07 08

Error opening table Error reading table Error writing to a table Error closing table Error in table record The file containing the table data is corrupt or has invalid data. The table filename is already registered and has an associated table ID. There is no table associated with the provided table ID.

09

Table filename duplication

10

Table ID invalid

90

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Table 129 Code


11

Database Packet Response Codes (continued) Description


Table limit reached

Comments
The limit of tables to be created has been reached.
MAX: 30

12

Field limit reached

The number of fields is greater than limit.


MAX: 100

99

Internal failure

Packet D00: Create Table

Packet D00 creates a table (database). Internally, the SC 5000 maintains a record of all created tables. It allows this set of DXX commands to manage the tables by table ID instead of filenames. Also, it checks to ensure that data received matches the tables structure (that is, number of fields, maximum size, and so on). Table IDs 1, 2, and 3 are reserved by the EMV application, as follows.
1 = EST.DAT 2 = MVT.DAT 3 = EMVG_CNF.DAT

NOTE

The maximum number of tables is 30. Table 130 Packet D00 Format Characteristic
1H 3AN up to 30AN 1H 3N

Data Element
<STX> Packet type [Data Base name] <FS> [Len of Field Sizes]

Comments
Start of Text, Value: 02h Value: D00 Name of the physical file, including its extension. Field separator, Value: 1Ch Number of the fields making up the table record, multiplied by 3 (three bytes per field size 3N).
MAX: 100 X 3 = 300

[Field 1 Size] ... [Field n Size] <ETX> {LRC}

3N 3N 1H 1H

Maximum string size accepted for field 1. ... Maximum string size accepted for field n. End of Text, Value: 03h Error Check

Packet D00 Length

MAX: 340 characters MIN: 14 characters

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

91

D ATABASE S ERVICES Database Communication Packets

Packet D00 Example


<STX>D00TEST.DAT<FS>009005010020<ETX>{LRC}

Table 131

Response Packet Format Characteristic


1H 3AN 2N 2N 1H 1H

Data Element
<STX> Packet type [Response Code] [Table ID] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: DXX According to Table 129 ID to use in further table accesses End of Text, Value: 03h Error Check

Response Packet Length

MAX: 10 characters MIN: 10 characters

Response Packet Example


<STX>D000004<ETX>{LRC}

Table 132

Packet D00 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D00[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Table created
<STX>D00RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

92

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Packet D01: Table Info

Packet D01 extracts the internally recorded table data for all or one specific table. Table 133 Packet D01 Format Characteristic
1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Table ID] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D01 00 for all tables End of Text, Value: 03h Error Check

Packet D01 Length

MAX: 8 characters MIN: 8 characters

Packet D01 Example


<STX>D0100<ETX>{LRC}

Table 134

Response Packet Format Characteristic


1H 3AN 2N 2N

Data Element
<STX> Packet type [Response Code] [Number of Data Tables]

Comments
Start of Text, Value: 02h Value: D01 According to Table 129 Returns 01 for a specific table (Table ID different from 00 on request) or the number of recorded tables (= m). Length of the following data until the end of the packet. First recorded table info. Field Separator, Value: 1Ch ... mth recorded table info Field Separator, Value: 1Ch End of Text, Value: 03h Error Check

[Length] [Table Info 1] <FS> ... [Table Info m] <FS> <ETX> {LRC}

3N var 1H var 1H 1H 1H

Response Packet Length

MAX: depends on the table features MIN: 17 characters

Response Packet Example


<STX>D010001017TEST.DAT<FS>03<FS>50<FS>4<FS><ETX>{LRC}

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

93

D ATABASE S ERVICES Database Communication Packets

Table 135

Packet D01 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D01[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database record inquiry.


<STX>D01RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D02: Seek Record

Packet D02 seeks the first record in a specified database that meets all specified conditions (AND logic). Table 136 Packet D02 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D02
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 04-30 = user-defined

[Starting Record] [Number of Conditions] [Length] [Condition 1] <FS> ... [Condition m] <FS> <ETX> {LRC}

3N 2N 3N var 1H var 1H 1H 1H

Continue searching from a specific record in the table, starting at 1.


MAX = 5

Length of the following data until the end of the packet. First condition to meet. Field Separator, Value: 1Ch ... mth condition to meet. Field Separator, Value: 1Ch End of Text, Value: 03h Error Check

Packet D02 Length

MAX: depends on the length of the conditions MIN: 20 characters

94

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Packet D02 Example


<STX>D020400101007003011<FS><ETX>{LRC}

Table 137

Response Packet Format Characteristic


1H 3AN 2N 3N 3N 3N var 1H 1H

Data Element
<STX> Packet type [Response Code] [Record Number] [Num Fields] [Length] [Record] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D02 According Table 129 Number of the first record found Number of fields that follows Length of the following field Record fields separated by <FS> End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the length of the record MIN: 18 characters

Response Packet Example


<STX>D0200003AAA<FS>BBB<FS>1<FS><ETX>{LRC}

Table 138

Packet D02 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D02[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database search
<STX>D02RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

95

D ATABASE S ERVICES Database Communication Packets

Packet D03: Read Record

Packet D03 reads the contents of a specified record from a specified table. Table 139 Packet D03 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D03
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 04-30 = user defined

[Record Number] <ETX> {LRC}

3N 1H 1H

Starts at 1. End of Text, Value: 03h Error Check

Packet D03 Length

MAX: 11 characters MIN: 11 characters

Packet D03 Example


<STX>D0304003<ETX>{LRC}

Table 140

Response Packet Format Characteristic


1H 3AN 2N 3N 3N var 1H 1H

Data Element
<STX> Packet type [Response Code] [Num Fields] [Length] [Record] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D03 According Table 129 Number of fields that follows Length of the following field Record fields separated by <FS> End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the length of the record MIN: 15 characters

Response Packet Example


<STX>D0300004012AAA<FS>BBB<FS>123<FS><ETX>{LRC}

96

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Table 141

Packet D03 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D03[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database read record


<STX>D03RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D04: Add New Record

Packet D04 adds a new record to the specified table. The new record is appended to the end of the table. Table 142 Packet D04 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D04
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 04-30 = user defined

[Num Fields] [Length] [Record] <ETX> {LRC}

3N 3N var 1H 1H

Number of fields that follows Length of the following field Record fields separated by <FS> End of Text, Value: 03h Error Check

Packet D04 Length

MAX: depends on the length of the record MIN: 15 characters

Packet D04 Example


<STX>D0405003015111<FS>1234<FS>TESTE<FS><ETX>{LRC}

Table 143

Response Packet Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type [Response Code]

Comments
Start of Text, Value: 02h Value: D04 According to Table 129

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

97

D ATABASE S ERVICES Database Communication Packets

Table 143

Response Packet Format (continued) Characteristic


3N 1H 1H

Data Element
[Record Number] <ETX> {LRC}

Comments
Number of the first record available End of Text, Value: 03h Error Check

Response Packet Length

MAX: 11 characters MIN: 11 characters

Response Packet Example


<STX>D0400007<ETX>{LRC}

Table 144

Packet D04 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D04[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database append record


<STX>D04RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D05: Update Record

Packet D05 updates the contents of a specific record in the specified table. Table 145 Packet D05 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D05
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 04-30 = user defined

[Record Number] [Num Fields] [Length] [Record] <ETX> {LRC} 98

3N 3N 3N var 1H 1H

Number of the first record found Number of fields that follows Length of the following field Record fields separated by <FS> End of Text, Value: 03h Error Check

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Packet D05 Length

MAX: depends on the length of the record MIN: 18 characters

Packet D05 Example


<STX>D0504001003012AAA<FS>CCC<FS>123<FS><ETX>{LRC}

Table 146

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Response Code] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D05 According to Table 129) End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>D0500<ETX>{LRC}

Table 147
s

Packet D05 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D05[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database record update


<STX>D05RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D06: Delete Record

Packet D06 facilitates deletion of a specific record in the specified table. Subsequent records move up to the deleted records position (that is, if record 3 is deleted, record 4 becomes 3, 5 becomes 4, and so on).

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

99

D ATABASE S ERVICES Database Communication Packets

Table 148

Packet D06 Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D06
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 0430 = user defined

[Record Number] <ETX> {LRC}

3N 1H 1H

Number of the first record found End of Text, Value: 03h Error Check

Packet D06 Length

MAX: 11 characters MIN: 11 characters

Packet D06 Example


<STX>D0601001<ETX>{LRC}

Table 149

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Response Code] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D06 According to Table 129 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>D0600<ETX>{LRC}

Table 150

Packet D06 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D06[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database record deleted 100


SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Table 150

Packet D06 Communication Protocol (continued) Transmit Direction PIN Pad


<STX>D06RR[data]<ETX>{LRC}

Master Device

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D07: Delete Table

Packet D07 deletes an existing table (database). Table 151 Packet D07 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D07
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 0430 = user defined

<ETX> {LRC}

1H 1H

End of Text, Value: 03h Error Check

Packet D07 Length

MAX: 8 characters MIN: 8 characters

Packet D07 Example


<STX>D0704<ETX>{LRC}

Table 152

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Response Code] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D07 According to Table 129 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>D0700<ETX>{LRC} SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

101

D ATABASE S ERVICES Database Communication Packets

Table 153

Packet D07 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D07[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database table deleted


<STX>D07RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Packet D08: Get Field from Table

Packet D08 gets a field and the maximum length accepted for the specified table. Table 154 Packet D08 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D08
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 0430 = user defined

[Record Number] [Field Number] <ETX> {LRC}

3N 3N 1H 1H

Starts at 1 Number of the field. See Field Format, page 86 End of Text, Value: 03h Error Check

Packet D08 Length

MAX: 14 characters MIN: 14 characters

Packet D08 Example


<STX>D0801001005<ETX>{LRC}

Table 155

Response Packet Format Characteristic


1H 3AN 2N 3N

Data Element
<STX> Packet type [Response Code] [Field Data Len] 102

Comments
Start of Text, Value: 02h Value: D08 According to Table 129 Current length of field data (x)

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Table 155

Response Packet Format Characteristic


xAN 3N 1H 1H

Data Element
[Field Data] [Maximum Field Data Len] <ETX> {LRC}

Comments
Field data Maximum accepted length for the field. End of Text, Value: 03h Error Check

Response Packet Length

MAX: depends on the length of the field MIN: 15 characters

Response Packet Example


<STX>D0800003ABC005<ETX>{LRC}

Table 156

Packet D08 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D08[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database inquiry
<STX>D08RR[data]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

103

D ATABASE S ERVICES Database Communication Packets

Packet D09: Put Field into Table

Packet D09 updates a field value of the specified table. Table 157 Packet D09 Format Characteristic
1H 3AN 2N

Data Element
<STX> Packet type [Table ID]

Comments
Start of Text, Value: 02h Value: D09
01 = EST.DAT 02 = MVT.DAT 03 = EMVG_CNF.DAT 0430 = user defined

[Record Number] [Field Number] [Field Data Len] [Field Data] <ETX> {LRC}

3N 3N 3N xAN 1H 1H

Starting from 1 Field number. See Field Format, page 86 Current length of [Field Data] (x) Field data End of Text, Value: 03h Error Check

Packet D09 Length

MAX: depends on the length of the field MIN: 18 characters

Packet D09 Example


<STX>D0901001005003ABC<ETX>{LRC}

Table 158

Response Packet Format Characteristic


1H 3AN 2N 1H 1H

Data Element
<STX> Packet type [Response Code] <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: D09 According to Table 129 End of Text, Value: 03h Error Check

Response Packet Length

MAX: 8 characters MIN: 8 characters

Response Packet Example


<STX>D0900<ETX>{LRC}

104

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

D ATABASE S ERVICES Database Communication Packets

Table 159

Packet D09 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>D09[parms]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

Database updated
<STX>D09RR<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

105

D ATABASE S ERVICES Database Communication Packets

106

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 8
Application Switching Packets
This section presents the packets for application switching.

Packet P00: Remote Application Selection

The master device (for example, an ECR) uses packet P00 to select the required application without user interface on the SC 5000.

If the application GID received by the currently selected application is valid (that is, the selected application exists in the SC 5000), the SC 5000 (that is, the new application) responds with packet P00 and the result is 00. If the application ID received is invalid (that is, does not exist), the currently selected application responds with packet P00 and the result is 01.

NOTE

All information is provided by the OS in the SC 5000. No configuration table is required. Table 160 Packet P00 Format Characteristic
1H 3AN 2AN 1H 1H

Data Element
<STX> Packet type Application GID <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: P00 01 to 15 End of Text, Value: 03h Error Check

Packet P00 Length

MAX: 8 characters MIN: 8 characters

Packet P00 Example


<STX>P0001<ETX>{LRC}

Table 161

Response Packet Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type Result

Comments
Start of Text, Value: 02h Value: P00 00 = app selected

01 = impossible to select required app


SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

107

A PPLICATION S WITCHING P ACKETS

Table 161

Response Packet Format (continued) Characteristic


1H 1H

Data Element
<ETX> {LRC}

Comments
End of Text, Value: 03h Error Check

Response Packet Length

MAX: 7 characters MIN: 7 characters

Response Packet Example


<STX>P0000<ETX>{LRC}

Table 162

Packet P00 Communication Protocol Transmit Direction PIN Pad

Master Device
<STX>P00[app GID]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect. EOT after 3 NAKs


<STX>P00[result]<ETX>{LRC}

ACK if LRC okay NAK if LRC incorrect. EOT after 3 NAKs

Packet P01: Who are You?


NOTE

Packet P01 tells the master device which application is running on the SC 5000. The response contains the GID and executable filename (without the extension).

All information is provided by the OS SC 5000. No configuration table is required.

Table 163

Packet P01 Format Characteristic


1H 3AN 1H 1H

Data Element
<STX> Packet type <ETX> {LRC}

Comments
Start of Text, Value: 02h Value: P01 End of Text, Value: 03h Error Check

Packet P01 Length


108

MAX: 8 characters MIN: 8 characters

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

A PPLICATION S WITCHING P ACKETS

Packet P01 Example


<STX>P01<ETX>{LRC}

Table 164

Response Packet Format Characteristic


1H 3AN 2N

Data Element
<STX> Packet type Result

Comments
Start of Text, Value: 02h Value: P01
00 = success 01 = cannot to obtain application

information Application GID Application Name <ETX> {LRC} 2N VAN 1H 1H 1 to 15 Application executable filename without extension. End of Text, Value: 03h Error Check

Response Packet Length

MAX: 7 characters MIN: 7 characters

Response Packet Example


<STX>P010002EMVGAPP<ETX>{LRC}

Table 165

Packet P01 Communication Protocol Transmit Direction PIN Pad


PIN-Pad
ACK if LRC okay NAK if LRC incorrect. EOT after 3 NAKs
<STX>P01[result][GID][Name]<ETX>{LRC}

Master Device
Master Device

ACK if LRC okay NAK if LRC incorrect. EOT after 3 NAKs

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

109

A PPLICATION S WITCHING P ACKETS

110

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

CHAPTER 9
EMV Application Configuration File
The EMVG_CNF.DAT file is a DAT file generated outside the SC 5000 unit by the GENDATA.EXE VeriFone utility. The file has only one record and contains all configurable data for the EMV Application, broken up into the following fields:

UART Baud Rate - Baud Rate from 1200 to 115200 UART Data Bits - Data Bits 7 or 8 UART Parity - Parity O, E, N UART Stop Bits - Stop Bits 1 or 2 UART Timeout - Protocol timeout (default = 15 seconds) Serial Number - Slot for an user application SN (optional use) Supported Language 1 - Supported Language 1 ISO-639 (default = English "en") Supported Language 2 - Supported Language 2 ISO-639 (default = Spanish "es") Supported Language 3 - Supported Language 3 ISO-639 (default = Portugese - "po") Supported Language 4 - Supported Language 4 ISO-639 (default = French "fr") Selected Language - Current selected language - 1 to 4 Active Language - Current selected language - 1 to 4 Idle Prompt - User defined idle-prompt (after a Z8 message) Unsolicited Enable - 0 = Unsolicited Messages disabled, 1 = Enabled Unsolicited Timeout - Timeout to wait for an ACK after sending ENQ Back-Light Enable - 0 = Disabled, 1 = Enabled Key Injection Style - 0 = ClearText, 1 = 3DES (this is not used by EMV Application. VeriFone provides this option for compatibility with PIN pad Emulation Application). Magnetic Stripe Reading Config Byte - Reserved for future use. Its value has no effect at this release.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

111

EMV A PPLICATION C ONFIGURATION F ILE

Figure 2 Field

Configuration Table - EMVG_CNF.DAT


Type Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Null Terminated string Size 6+1 1+1 1+1 1+1 3+1 16 + 1 2+1 2+1 2+1 2+1 1+1 1+1 32 + 1 1+1 3+1 1+1 1+1 2+1

1-UART Baud Rate 2-UART Data Bits 3-UART Parity 4-UART Stop Bits 5- UART Timeout 6- Serial Number 7- Supported Language 1 8- Supported Language 2 9- Supported Language 3 10- Supported Language 4 11-Selected Language 12-Active Language 13- Idle Prompt 14- Unsolicited Enable 15- Unsolicited Disable 16- Back Light Enable 17- Key Injection Style 18- Mag Stripe Reading Config Byte

112

SC 5000 EMV A PPLICATION ARCHITECTURE AND INTERFACE GUIDE

APPENDIX
Certification Authority Public Key Files
The SC 5000 unit uses Certification Authority Public Key (CAPK) files. These binary files contain:

5 bytes for the RID 1 byte for PK Index 1 byte CAPK Modulus length = n n bytes CAPK Modulus 1byte CAPK Exponent length = m m bytes CAPK Exponent 20 bytes CAPK Hash Value (optional)

VeriFone recommends using filenames with some reference to CAPK and PK Index. The file extension has to be .EMV. Example: A398.EMV for RID A000000003 and PK Index 98.

SC 5000 EMV APPLICATION ARCHITECTURE AND INTERFACE GUIDE

113

p b` k^f imm^

uuPP=fkjl

klfq^`f imm^Jfqi rj

p b` k^f imm^ klfq^`f imm^Jfqi rj obq kr l` Jo bs lJak^e

uuTP=fkjl

bo rq` bqfe`o^

aibfepfobs

vqfor` bp

a^m kfm bi_^jj^od lom abq^o dbq kf

M MM R=`p

EMV Application Architecture and Interface Guide

boqkb`fobs

q kbjb d^ k^j =b`k^fimm^

bqfrp

VeriFone Part Number 22595, Revision A

SC 5000
VeriFone, Inc. 2455 Augustine Drive Santa Clara CA 95054-3002 Tel: 800-VeriFone (837-4366) www.verifone.com

You might also like