Book 3 – Application Specification

v4.3 Specifications
Contact Acceptance DeviceCard

EMV Integrated Circuit Card Specifications for Payment Systems Book 3 Application Specification Version 4.3 November 2011

EMV®* Integrated Circuit Card Specifications for Payment Systems Book 3 Application Specification Version 4.3 November 2011 * EMV is a registered trademark in the U.S. and other countries and an unregistered trademark elsewhere. The EMV trademark is owned by EMVCo.

EMV 4.3 Book 3 Application Specification © 2011 EMVCo, LLC (“EMVCo”). All rights reserved. Any and all uses of these Specifications are subject to the terms and conditions of the EMVCo Terms of Use agreement available at www.emvco.com. These Specifications are provided "AS IS" without warranties of any kind, and EMVCo neither assumes nor accepts any liability for any errors or omissions contained in these Specifications. EMVCO DISCLAIMS ALL REPRESENTATIONS AND WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT, AS TO THESE SPECIFICATIONS. EMVCo makes no representations or warranties with respect to intellectual property rights of any third parties in or in relation to the Specifications. EMVCo undertakes no responsibility to determine whether any implementation of these Specifications may violate, infringe, or otherwise exercise the patent, copyright, trademark, trade secret, know-how, or other intellectual property rights of third parties, and thus any person who implements any part of these Specifications should consult an intellectual property attorney before any such implementation. Without limiting the foregoing, the Specifications may provide for the use of public key encryption and other technology, which may be the subject matter of patents in several countries. Any party seeking to implement these Specifications is solely responsible for determining whether its activities require a license to any such technology, including for patents on public key encryption technology. EMVCo shall not be liable under any theory for any party's infringement of any intellectual property rights in connection with these Specifications.

November 2011

EMV 4.3 Book 3 Application Specification Revision Log - Version 4.3 The following changes have been made to Book 3 since the publication of Version 4.2. Numbering and cross references in this version have been updated to reflect changes introduced by the published bulletins. Incorporated changes described in the following Specification Updates: Specification Update Bulletin no. 68: '61La' Response when using T=1 Specification Update Bulletin no. 69 Second Edition: Padding of BER-TLV Encoded Constructed Data Objects Specification Update Bulletin no. 72: DDA support in terminals Incorporated changes described in the following Specification Bulletins: Specification Bulletin no. 78: Removal of DDF Entries from PSE Records Specification Bulletin no. 79: Amount Requested in the PDOL Specification Bulletin no. 82: Various Terminal Updates Specification Bulletin no. 83: Incorrectly Formatted ICC Data Objects Specification Bulletin no. 85: CVM Results after a CVM Failure Specification Bulletin no. 87: Reserve AIP Bit for Contactless Specification Bulletin no. 88: Application Selection Updates Specification Bulletin no. 89: EMV Tag Allocations Specification Bulletin no. 91: AES Support in Common Core

Definitions

Minor editorial clarifications, including those described in the following Specification Bulletin: Specification Bulletin no. 80: Editorial Errors in Version 4.2 of the EMV Specifications November 2011

EMV 4.3 Book 3 Application Specification Part I

  • General Contents 1 Scope 3 1.1 Changes in Version 4.3 3 1.2 Structure 3 1.3 Underlying Standards 4 1.4 Audience 4 2 Normative References 5 3 Definitions 9 4 Abbreviations, Notations, Conventions, and Terminology 19 4.1 Abbreviations 19 4.2 Notations 27 4.3 Data Element Format Conventions 29 4.4 Terminology 31 Part II
  • Data Elements and Commands 5 Data Elements and Files 35 5.1 Data Elements Associated with Financial Transaction Interchange 35 5.2 Data Objects 36 5.2.1 Classes of Data Objects 36 5.3 Files 37 5.3.1 Application Elementary Files 37 5.3.2 File Referencing 37 5.4 Rules for Using a Data Object List (DOL) 38 6 Commands for Financial Transaction 41 6.1 Command APDU Format 41 6.2 Response APDU Format 41 6.3 Coding Conventions 42 6.3.1 Coding of the Class Byte 42 6.3.2 Coding of the Instruction Byte 43 6.3.3 Coding of Parameter Bytes 43 6.3.4 Coding of Data Field Bytes 44 6.3.5 Coding of the Status Bytes 44 6.3.6 Coding of RFU Data 47 November 2011 Page v EMV 4.3 Book 3 Application Specification 6.4 Logical Channels 47 6.5 Commands 48 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 APDUs 6.5.6 6.5.7 6.5.8 6.5.9 6.5.10 6.5.11 6.5.12 APPLICATION BLOCK Command-Response APDUs 49 APPLICATION UNBLOCK Command-Response APDUs 50 CARD BLOCK Command-Response APDUs 51 EXTERNAL AUTHENTICATE Command-Response APDUs 52 GENERATE APPLICATION CRYPTOGRAM Command-Response 54 GET CHALLENGE Command-Response APDUs 57 GET DATA Command-Response APDUs 58 GET PROCESSING OPTIONS Command-Response APDUs 59 INTERNAL AUTHENTICATE Command-Response APDUs 61 PIN CHANGE/UNBLOCK Command-Response APDUs 63 READ RECORD Command-Response APDUs 65 VERIFY Command-Response APDUs 67 Part III
  • Debit and Credit Application Specification 7 Files for Financial Transaction Interchange 73 7.1 Mapping Data Objects 73 7.2 Mandatory Data Objects 74 7.3 Data Retrievable by GET DATA Command 76 7.4 Data Retrievable by GET PROCESSING OPTIONS 76 7.5 Erroneous or Missing Data in the ICC 77 8 Transaction Flow 81 8.1 Exception Handling 81 8.2 Example Flowchart 81 8.3 Additional Functions 83 9 GENERATE AC Command Coding 85 9.1 Command Parameters 87 9.2 Command Data 87 9.2.1 Card Risk Management Data 87 9.2.2 Transaction Certificate Data 88 9.3 Command Use 88 9.3.1 GENERATE AC (First Issuance) 89 9.3.2 GENERATE AC (Second Issuance) 89 10 Functions Used in Transaction Processing 91 10.1 Initiate Application Processing 91 10.2 Read Application Data 93 November 2011 EMV 4.3 Book 3 Application Specification 10.3 Offline Data Authentication 10.4 Processing Restrictions 10.4.1 10.4.2 10.4.3 Application Version Number Application Usage Control Application Effective/Expiration Dates Checking 10.5 Cardholder Verification 10.5.1 10.5.2 10.5.3 10.5.4 10.5.5 Offline PIN Processing Online PIN Processing Signature Processing Combination CVMs CVM Processing Logic 10.6 Terminal Risk Management 10.6.1 10.6.2 10.6.3 Floor Limits Random Transaction Selection Velocity Checking 10.7 Terminal Action Analysis 10.8 Card Action Analysis 10.8.1 Terminal Messages for an AAC 10.8.2 Advice Messages 10.9 Online Processing 10.10 Issuer-to-Card Script Processing 10.11 Completion Part IV
  • Annexes Annex A Data Elements Dictionary A1 Data Elements by Name A2 Data Elements by Tag Annex B Rules for BER-TLV Data Objects B1 Coding of the Tag Field of BER-TLV Data Objects B2 Coding of the Length Field of BER-TLV Data Objects B3 Coding of the Value Field of Data Objects Annex C Coding of Data Elements Used in Transaction Processing C1 Application Interchange Profile C2 Application Usage Control C3 Cardholder Verification Rule Format C4 Issuer Code Table Index November 2011 95 98 98 98 99 100 103 104 104 104 104 110 111 111 113 114 118 119 119 120 122 124 127 127 150 155 156 157 158 159 160 161 162 164 EMV 4.3 Book 3 Application Specification C5 Terminal Verification Results 165 C6 Transaction Status Information 168 Annex D Transaction Log Information 169 D1 Purpose 169 D2 Conditions of Execution 169 D3 Sequence of Execution 169 D4 Description 170 D5 Example 171 Annex E TVR and TSI Bit Settings Following Script Processing 173 E1 Scenarios 173 E2 Additional Information 175 Annex F Status Words Returned in EXTERNAL AUTHENTICATE 177 Part V
  • Common Core Definitions Introduction 182 Changed and Added Sections 182 6 Commands for Financial Transaction 183 6.2 Response APDU Format 183 6.5 Commands 183 6.5.4 EXTERNAL AUTHENTICATE Command-Response APDUs 183 6.5.5 GENERATE APPLICATION CRYPTOGRAM Command- Response APDUs 183 6.5.8 GET PROCESSING OPTIONS Command-Response APDUs 184 6.5.9 INTERNAL AUTHENTICATE Command-Response APDUs 185 7 Files for Financial Transaction Interchange 186 7.3 Data Retrievable by GET DATA Command 186 9 GENERATE AC Command Coding 187 9.2 Command Data 187 9.2.2 Transaction Certificate Data 187 9.2.3 Common Core Definitions Card Verification Results 187 9.3 Command Use 197 10 Functions Used in Transaction Processing 198 10.5 Cardholder Verification 198 10.5.1 Offline PIN Processing 198 10.8 Card Action Analysis 198 10.8.1 Terminal Messages for an AAC 198 November 2011 EMV 4.3 Book 3 Application Specification 10.8.2 Advice Messages 198 10.10 Issuer-to-Card Script Processing 198 10.11 Completion 199 10.11.1 Additional Completion Actions for a CCD-Compliant Application 199 Annex A Data Elements Dictionary 203 Annex C Coding of Data Elements Used in Transaction Processing 205 C7 Issuer Application Data for a Common Core Definitions-Compliant Application 205 C7.1 Common Core Identifier 205 C7.2 Issuer Application Data for Format Code 'A' 206 C7.3 Card Verification Results 207 C8 Card Status Update for a Common Core Definitions-Compliant Application 209 Annex D Transaction Log Information 210 Index 211 November 2011 EMV 4.3 Book 3 Application Specification Page x November 2011 EMV 4.3 Book 3 Application Specification Tables Table 1: Structure of SFI 38 Table 2: Most Significant Nibble of the Class Byte 42 Table 3: Coding of the Instruction Byte 43 Table 4: Coding of Status Bytes SW1 SW2 45 Table 5: Allocation of Status Bytes 46 Table 6: APPLICATION BLOCK Command Message 49 Table 7: APPLICATION UNBLOCK Command Message 50 Table 8: CARD BLOCK Command Message 51 Table 9: EXTERNAL AUTHENTICATE Command Message 52 Table 10: GENERATE AC Cryptogram Types 54 Table 11: GENERATE AC Command Message 54 Table 12: GENERATE AC Reference Control Parameter 55 Table 13: Format 1 GENERATE AC Response Message Data Field 55 Table 14: Coding of Cryptogram Information Data 56 Table 15: GET CHALLENGE Command Message 57 Table 16: GET DATA Command Message 58 Table 17: GET PROCESSING OPTIONS Command Message 59 Table 18: INTERNAL AUTHENTICATE Command Message 61 Table 19: PIN CHANGE/UNBLOCK Command Message 64 Table 20: READ RECORD Command Message 65 Table 21: READ RECORD Command Reference Control Parameter 65 Table 22: VERIFY Command Message 67 Table 23: VERIFY Command qualifier of reference data (P2) 68 Table 24: Plaintext Offline PIN Block Format 69 Table 25: Data Objects Used by the Offline Data Authentication Algorithm 74 Table 26: Mandatory Data Objects 74 Table 27: Data Required for SDA 75 Table 28: Data Required for DDA and/or CDA 75 Table 29: Data Objects Retrievable by GET DATA Command 76 Table 30: Data Retrievable by GET PROCESSING OPTIONS 76 Table 31: ICC Data Missing Indicator Setting 79 November 2011 EMV 4.3 Book 3 Application Specification Table 32: Terminal Action Regarding Application Usage Control 99 Table 33: Data Elements Dictionary 127 Table 34: Data Elements Tags 150 Table 35: Tag Field Structure (First Byte) BER-TLV 156 Table 36: Tag Field Structure (Subsequent Bytes) BER-TLV 156 Table 37: Application Interchange Profile 160 Table 38: Application Usage Control 161 Table 39: CVM Codes 162 Table 40: CVM Condition Codes 163 Table 41: Issuer Code Table Index 164 Table 42: Terminal Verification Results 165 Table 43: Transaction Status Information 168 Table 44: Log Entry 170 Table 45: Example of Log Format 171 Table 46: Terminal Action after (First) EXTERNAL AUTHENTICATE Response 177 Table 47: Account Type 179 Table CCD 1: Body of Response APDU Structure 183 Table CCD 2: Format 2 GENERATE AC Response Message Data Field 184 Table CCD 3: Coding of Cryptogram Information Data 184 Table CCD 4: Format 2 GET PROCESSING OPTIONS Response Message Data Field 185 Table CCD 5: Format 2 Internal Authenticate Response Message Data Field 185 Table CCD 6: Data Elements Not Used by a CCD-Compliant Application 203 Table CCD 7: Additional Data Elements Defined for CCD 204 Table CCD 8: Common Core Identifier 205 Table CCD 9: Issuer Application Data for Format Code 'A' 206 Table CCD 10: Card Verification Results for Format Code 'A' 207 Table CCD 11: Card Status Update for Cryptogram Versions '5' and '6' 209 November 2011 EMV 4.3 Book 3 Application Specification Figures Figure 1: Command APDU Structure 41 Figure 2: Response APDU Structure 41 Figure 3: Structural Scheme of Status Bytes 44 Figure 4: Format 1 GET PROCESSING OPTIONS Response Message Data Field 60 Figure 5: READ RECORD Response Message Data Field 66 Figure 6: Transaction Flow Example 82 Figure 7: Use of GENERATE AC Options 86 Figure 8: CVM Processing (Part 1 of 5) 105 Figure 9: CVM Processing (Part 2 of 5) 106 Figure 10: CVM Processing (Part 3 of 5) 107 Figure 11: CVM Processing (Part 4 of 5) 108 Figure 12: CVM Processing (Part 5 of 5) 109 Figure 13: Random Transaction Selection Example 112 Figure 14: Issuer Script Format 123 Figure 15: Issuer Script Command Format (Shown with Three Commands) 123 Figure 16: Primitive BER-TLV Data Object (Data Element) 158 Figure 17: Constructed BER-TLV Data Object 158 November 2011 EMV 4.3 Book 3 Application Specification Part I General November 2011 EMV 4.3 Book 3 Application Specification 1

Scope

This document, the Integrated Circuit Card Specifications for Payment Systems Book 3, Application Specification defines the terminal and integrated circuit card (ICC) procedures necessary to effect a payment system transaction in an international interchange environment. The Integrated Circuit Card Specifications for Payment Systems includes the following additional documents, all available on http://www.emvco.com:

  • Book 1 - Application Independent ICC to Terminal Interface Requirements
  • Book 2 - Security and Key Management
  • Book 4 - Cardholder, Attendant, and Acquirer Interface Requirements 1.1 Changes in Version 4.3 This release incorporates all relevant Specification Update Bulletins, Application Notes, amendments, etc. published up to the date of this release. The Revision Log at the beginning of the Book provides additional detail about changes to this specification.

1.2 Structure Book 3 consists of the following parts: Part I - General Part II - Data Elements and Commands Part III - Debit and Credit Application Specification Part IV - Annexes Part V - Common Core Definitions Part I includes this introduction, as well as data applicable to all Books: normative references, definitions, abbreviations, notations, data element format convention, and terminology. Part II describes data elements and files as well as commands for financial transaction. November 2011

1 Scope 1.3 Underlying Standards EMV 4.3 Book 3 Application Specification Part III specifies the debit and credit application functions including:

  • Transaction flow (the sequence of events and the commands issued to the card)
  • Exception processing
  • Definition of data elements and commands as they apply to the exchange of information between an ICC and a terminal. In particular,  Structure and referencing of files  The usage of commands between the ICC and the terminal to achieve application level functions. The functions described are those necessary to ensure that payment system cards conforming to this specification can perform a set of core functions in terminals conforming to this specification. Application functions unique to individual payment systems and those functions not performed in interchange are not described, but are not precluded. Part IV includes a complete data elements dictionary, rules for BER-TLV data objects, instructions for coding of specific data elements, and transaction log information. It discusses TVR and TSI bit settings following script processing, and Status Words returned in response to an EXTERNAL AUTHENTICATE command. Part V defines an optional extension to be used when implementing a card complying to the Common Core Definitions (CCD). The Book also includes a revision log and an index. This specification does not address clearing and settlement or any transactions where the ICC is not present.

1.3 Underlying Standards This specification is based on the ISO/IEC 7816 series of standards and should be read in conjunction with those standards. However, if any of the provisions or definitions in this specification differ from those standards, the provisions herein shall take precedence.

1.4 Audience This specification is intended for use by manufacturers of ICCs and terminals, system designers in payment systems, and financial institution staff responsible for implementing financial applications in ICCs.

November 2011

EMV 4.3 Book 3 Application Specification 2 Normative

References

The following standards contain provisions that are referenced in these specifications. The latest version shall apply unless a publication date is explicitly stated. ISO 639-1 ISO 3166 ISO 4217 ISO/IEC 7811-1 ISO/IEC 7811-3 ISO/IEC 7813 ISO/IEC 7816-1 ISO/IEC 7816-2 ISO/IEC 7816-3 Codes for the representation of names of languages – Part 1: Alpha-2 Code Note: This standard is updated continuously by ISO. Additions/changes to ISO 639-1:1988: Codes for the Representation of Names of Languages are available on: http://www.loc.gov/standards/iso6392/php/code_changes.php Codes for the representation of names of countries and their subdivisions Codes for the representation of currencies and funds Identification cards – Recording technique – Part 1: Embossing Identification cards – Recording technique – Part 3: Location of embossed characters on ID-1 cards Identification cards – Financial transaction cards Identification cards – Integrated circuit(s) cards with contacts – Part 1: Physical characteristics Information technology – Identification cards – Integrated circuit(s) cards with contacts – Part 2: Dimensions and location of contacts Identification cards — Integrated circuit cards — Part 3: Cards with contacts — Electrical interface and transmission protocols November 2011

2 Normative References ISO/IEC 7816-4 ISO/IEC 7816-5 ISO/IEC 7816-6 ISO 8583:1987 ISO 8583:1993 ISO/IEC 8825-1 ISO/IEC 8859 ISO 9362 ISO 9564-1:2011 ISO/IEC 9796-2:2010 ISO/IEC 9797-1:2011 ISO/IEC 10116 ISO/IEC 10118-3 EMV 4.3 Book 3 Application Specification Identification cards — Integrated circuit cards — Part 4: Organization, security and commands for interchange Identification cards — Integrated circuit cards — Part 5: Registration of application providers Identification cards – Integrated circuit cards – Part 6: Interindustry data elements for interchange Bank card originated messages – Interchange message specifications – Content for financial transactions Financial transaction card originated messages – Interchange message specifications Information technology – ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER) Information processing – 8-bit single-byte coded graphic character sets Banking – Banking telecommunication messages – Bank identifier codes Financial services – Personal Identification Number (PIN) management and security – Part 1: Basic principles and requirements for PINs in card-based systems Information technology – Security techniques – Digital signature schemes giving message recovery – Part 2: Integer factorization based mechanisms Information technology – Security techniques – Message Authentication Codes - Part 1: Mechanisms using a block cipher Information technology – Security techniques – Modes of operation for an n-bit block cipher Information technology – Security techniques – Hash-functions – Part 3: Dedicated hash-functions

November 2011

EMV 4.3 Book 3 Application Specification ISO/IEC 10373 ISO 13491-1 ISO 13616 ISO 16609 ISO/IEC 18031 ISO/IEC 18033-3 2 Normative References Identification cards – Test methods Banking – Secure cryptographic devices (retail) – Part 1: Concepts, requirements and evaluation methods Banking and related financial services – International bank account number (IBAN) Banking – Requirements for message authentication using symmetric techniques Information technology - Security techniques Random bit generation Information technology – Security techniques – Encryption algorithms – Part 3: Block ciphers November 2011

EMV 4.3 Book 3 Application Specification 3 Definitions The following terms are used in one or more books of these specifications. Accelerated Revocation A key revocation performed on a date sooner than the published key expiry date. Application The application protocol between the card and the terminal and its related set of data. Application Authentication Cryptogram An Application Cryptogram generated by the card when declining a transaction Application Cryptogram A cryptogram generated by the card in response to a GENERATE AC command. See also:

  • Application Authentication Cryptogram
  • Authorisation Request Cryptogram
  • Transaction Certificate Authorisation An Application Cryptogram generated by the card Request Cryptogram when requesting online authorisation Authorisation Response Cryptogram A cryptogram generated by the issuer in response to an Authorisation Request Cryptogram. Asymmetric Cryptographic Technique A cryptographic technique that uses two related transformations, a public transformation (defined by the public key) and a private transformation (defined by the private key). The two transformations have the property that, given the public transformation, it is computationally infeasible to derive the private transformation. Authentication The provision of assurance of the claimed identity of an entity or of data origin. Block A succession of characters comprising two or three fields defined as prologue field, information field, and epilogue field. Byte 8 bits. November 2011 3 Definitions Card Certificate Certification Authority Ciphertext Cold Reset Combined DDA/Application Cryptogram Generation Command Compromise Concatenation Contact Cryptogram EMV 4.3 Book 3 Application Specification A payment card as defined by a payment system. The public key and identity of an entity together with some other information, rendered unforgeable by signing with the private key of the certification authority which issued that certificate. Trusted third party that establishes a proof that links a public key and other relevant information to its owner. Enciphered information. The reset of the ICC that occurs when the supply voltage (VCC) and other signals to the ICC are raised from the inactive state and the reset (RST) signal is applied. A form of offline dynamic data authentication. A message sent by the terminal to the ICC that initiates an action and solicits a response from the ICC. The breaching of secrecy or security. Two elements are concatenated by appending the bytes from the second element to the end of the first. Bytes from each element are represented in the resulting string in the same sequence in which they were presented to the terminal by the ICC, that is, most significant byte first. Within each byte bits are ordered from most significant bit to least significant. A list of elements or objects may be concatenated by concatenating the first pair to form a new element, using that as the first element to concatenate with the next in the list, and so on. A conducting element ensuring galvanic continuity between integrated circuit(s) and external interfacing equipment. Result of a cryptographic operation. November 2011 EMV 4.3 Book 3 Application Specification 3 Definitions Cryptographic Algorithm Data Integrity Deactivation Sequence Decipherment Digital Signature Dynamic Data Authentication Embossing Encipherment Epilogue Field Exclusive-OR Financial Transaction Function An algorithm that transforms data in order to hide or reveal its information content. The property that data has not been altered or destroyed in an unauthorised manner. The deactivation sequence defined in section 6.1.5 of Book 1. The reversal of a corresponding encipherment. An asymmetric cryptographic transformation of data that allows the recipient of the data to prove the origin and integrity of the data, and protect the sender and the recipient of the data against forgery by third parties, and the sender against forgery by the recipient. A form of offline dynamic data authentication Characters raised in relief from the front surface of a card. The reversible transformation of data by a cryptographic algorithm to produce ciphertext. The final field of a block. It contains the error detection code (EDC) byte(s). Binary addition with no carry, giving the following values: 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 The act between a cardholder and a merchant or acquirer that results in the exchange of goods or services against payment. A process accomplished by one or more commands and resultant actions that are used to perform all or part of a transaction. November 2011 3 Definitions EMV 4.3 Book 3 Application Specification Guardtime The minimum time between the trailing edge of the parity bit of a character and the leading edge of the start bit of the following character sent in the same direction. Hash Function A function that maps strings of bits to fixed-length strings of bits, satisfying the following two properties:
  • It is computationally infeasible to find for a given output an input which maps to this output.
  • It is computationally infeasible to find for a given input a second input that maps to the same output. Additionally, if the hash function is required to be collision-resistant, it must also satisfy the following property:
  • It is computationally infeasible to find any two distinct inputs that map to the same output. Hash Result The string of bits that is the output of a hash function. Inactive The supply voltage (VCC) and other signals to the ICC are in the inactive state when they are at a potential of 0.4 V or less with respect to ground (GND). Integrated Circuit Module The sub-assembly embedded into the ICC comprising the IC, the IC carrier, bonding wires, and contacts. Integrated Circuit(s) Electronic component(s) designed to perform processing and/or memory functions. Integrated Circuit(s) A card into which one or more integrated circuits are Card inserted to perform processing and memory functions. Interface Device That part of a terminal into which the ICC is inserted, including such mechanical and electrical devices as may be considered part of it. Issuer Action Code Any of the following, which reflect the issuer-selected action to be taken upon analysis of the TVR:
  • Issuer Action Code - Default
  • Issuer Action Code - Denial
  • Issuer Action Code - Online November 2011 EMV 4.3 Book 3 Application Specification 3 Definitions Kernel The set of functions required to be present on every terminal implementing a specific interpreter. The kernel contains device drivers, interface routines, security and control functions, and the software for translating from the virtual machine language to the language used by the real machine. In other words, the kernel is the implementation of the virtual machine on a specific real machine. Key A sequence of symbols that controls the operation of a cryptographic transformation. Key Expiry Date The date after which a signature made with a particular key is no longer valid. Issuer certificates signed by the key must expire on or before this date. Keys may be removed from terminals after this date has passed. Key

Introduction

The process of generating, distributing, and beginning use of a key pair. Key Life Cycle All phases of key management, from planning and generation, through revocation, destruction, and archiving. Key Replacement The simultaneous revocation of a key and introduction of a key to replaced the revoked one. Key Revocation The key management process of withdrawing a key from service and dealing with the legacy of its use. Key revocation can be as scheduled or accelerated. Key Revocation Date The date after which no legitimate cards still in use should contain certificates signed by this key, and therefore the date after which this key can be deleted from terminals. For a planned revocation the Key Revocation Date is the same as the key expiry date. Key Withdrawal The process of removing a key from service as part of its revocation. Keypad Arrangement of numeric, command, and, where required, function and/or alphanumeric keys laid out in a specific manner. November 2011

3 Definitions EMV 4.3 Book 3 Application Specification Library A set of high-level software functions with a published interface, providing general support for terminal programs and/or applications. Logical Compromise The compromise of a key through application of improved cryptanalytic techniques, increases in computing power, or combination of the two. Magnetic Stripe The stripe containing magnetically encoded information. Message A string of bytes sent by the terminal to the card or vice versa, excluding transmission-control characters. Message Authentication Code A symmetric cryptographic transformation of data that protects the sender and the recipient of the data against forgery by third parties. Nibble The four most significant or least significant bits of a byte. Padding Appending extra bits to either side of a data string. Path Concatenation of file identifiers without delimitation. Payment System Environment A logical construct within the ICC, the entry point to which is a Directory Definition File (DDF) named '1PAY.SYS.DDF01'. This DDF contains a Payment System Directory which in turn contains entries for one or more Application Definition Files (ADFs) which are formatted according to this specification. Physical Compromise The compromise of a key resulting from the fact that it has not been securely guarded, or a hardware security module has been stolen or accessed by unauthorised persons. PIN Pad Arrangement of numeric and command keys to be used for personal identification number (PIN) entry. Plaintext Unenciphered information. Planned Revocation A key revocation performed as scheduled by the published key expiry date.

November 2011

EMV 4.3 Book 3 Application Specification 3 Definitions Potential Compromise Private Key Prologue Field Public Key Public Key Certificate Response Script Secret Key Signal Amplitude Signal Perturbations Socket A condition where cryptanalytic techniques and/or computing power has advanced to the point that compromise of a key of a certain length is feasible or even likely. That key of an entity’s asymmetric key pair that should only be used by that entity. In the case of a digital signature scheme, the private key defines the signature function. The first field of a block. It contains subfields for node address (NAD), protocol control byte (PCB), and length (LEN). That key of an entity’s asymmetric key pair that can be made public. In the case of a digital signature scheme, the public key defines the verification function. The public key information of an entity signed by the certification authority and thereby rendered unforgeable. A message returned by the ICC to the terminal after the processing of a command message received by the ICC. A command or a string of commands transmitted by the issuer to the terminal for the purpose of being sent serially to the ICC as commands. A key used with symmetric cryptographic techniques and usable only by a set of specified entities. The difference between the high and low voltages of a signal. Abnormalities occurring on a signal during normal operation such as undershoot/overshoot, electrical noise, ripple, spikes, crosstalk, etc. Random perturbations introduced from external sources are beyond the scope of this specification. An execution vector defined at a particular point in an application and assigned a unique number for reference. November 2011

3 Definitions State H State L Static Data Authentication Symmetric Cryptographic Technique T=0 T=1 Template Terminal Terminal Action Code Terminate Card Session Terminate Transaction EMV 4.3 Book 3 Application Specification Voltage high on a signal line. May indicate a logic one or logic zero depending on the logic convention used with the ICC. Voltage low on a signal line. May indicate a logic one or logic zero depending on the logic convention used with the ICC. Offline static data authentication A cryptographic technique that uses the same secret key for both the originator’s and recipient’s transformation. Without knowledge of the secret key, it is computationally infeasible to compute either the originator’s or the recipient’s transformation. Character-oriented asynchronous half duplex transmission protocol. Block-oriented asynchronous half duplex transmission protocol. Value field of a constructed data object, defined to give a logical grouping of data objects. The device used in conjunction with the ICC at the point of transaction to perform a financial transaction. The terminal incorporates the interface device and may also include other components and interfaces such as host communications. Any of the following, which reflect the acquirer-selected action to be taken upon analysis of the TVR:

  • Terminal Action Code - Default
  • Terminal Action Code - Denial
  • Terminal Action Code - Online End the card session by deactivating the IFD contacts according to section 6.1.5 of Book 1, and displaying a message indicating that the ICC cannot be used to complete the transaction Stop the current application and deactivate the card. November 2011 EMV 4.3 Book 3 Application Specification 3 Definitions Transaction Transaction Certificate Virtual Machine Warm Reset An action taken by a terminal at the user’s request. For a POS terminal, a transaction might be payment for goods, etc. A transaction selects among one or more applications as part of its processing flow. An Application Cryptogram generated by the card when accepting a transaction A theoretical microprocessor architecture that forms the basis for writing application programs in a specific interpreter software implementation. The reset that occurs when the reset (RST) signal is applied to the ICC while the clock (CLK) and supply voltage (VCC) lines are maintained in their active state. November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.1 µA µm µs a AAC AC ACK ADF AEF AFL AID AIP an ans APDU API ARC ARPC ARQC ASI ASN ATC Abbreviations Microampere Micrometre Microsecond Alphabetic (see section 4.3, Data Element Format Convention) Application Authentication Cryptogram Application Cryptogram Acknowledgment Application Definition File Application Elementary File Application File Locator Application Identifier Application Interchange Profile Alphanumeric (see section 4.3) Alphanumeric Special (see section 4.3) Application Protocol Data Unit Application Program Interface Authorisation Response Code Authorisation Response Cryptogram Authorisation Request Cryptogram Application Selection Indicator Abstract Syntax Notation Application Transaction Counter November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations EMV 4.3 Book 3 Application Specification ATM ATR AUC b BCD BER BIC BGT BWI BWT C CAD C-APDU CBC CCD CCI CDA CDOL CID CIN CLA CLK cn CPU CRL CSU C-TPDU CV Automated Teller Machine Answer to Reset Application Usage Control Binary (see section 4.3) Binary Coded Decimal Basic Encoding Rules (defined in ISO/IEC 8825-1) Bank Identifier Code Block Guardtime Block Waiting Time Integer Block Waiting Time Celsius or Centigrade Card Accepting Device Command APDU Cipher Block Chaining Common Core Definitions Common Core Identifier Combined DDA/Application Cryptogram Generation Card Risk Management Data Object List Cryptogram Information Data Input Capacitance Class Byte of the Command Message Clock Compressed Numeric (see section 4.3) Central Processing Unit Certificate Revocation List Card Status Update Command TPDU Cryptogram Version November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations CVM CVR CV Rule CWI CWT D DAD DC DDA DDF DDOL DES DF DIR DOL ECB EDC EF EN etu f FC FCI GND GP Hex HHMMSS I/O Cardholder Verification Method Card Verification Results Cardholder Verification Rule Character Waiting Time Integer Character Waiting Time Bit Rate Adjustment Factor Destination Node Address Direct Current Dynamic Data Authentication Directory Definition File Dynamic Data Authentication Data Object List Data Encryption Standard Dedicated File Directory Data Object List Electronic Code Book Error Detection Code Elementary File European Norm Elementary Time Unit Frequency Format Code File Control Information Ground Grandparent key for session key generation Hexadecimal Hours, Minutes, Seconds Input/Output November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations EMV 4.3 Book 3 Application Specification IAC IAD IBAN I-block IC ICC ICC IEC IFD IFS IFSC IFSD IFSI IIN IK INF INS IOH IOL ISO IV KM KS L l.s. Lc LCOL Issuer Action Code (Denial, Default, Online) Issuer Application Data International Bank Account Number Information Block Integrated Circuit Integrated Circuit(s) Card Current drawn from VCC International Electrotechnical Commission Interface Device Information Field Size Information Field Size for the ICC Information Field Size for the Terminal Information Field Size Integer Issuer Identification Number Intermediate Key for session key generation Information Field Instruction Byte of Command Message High Level Output Current Low Level Output Current International Organization for Standardization Initial Vector for session key generation Master Key Session Key Length Least Significant Exact Length of Data Sent by the TAL in a Case 3 or 4 Command Lower Consecutive Offline Limit November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations LDD Le LEN Licc Lr LRC M mΩ MΩ m.s. m/s mA MAC max. MF MHz min. MK mm MMDD MMYY N n NAD NAK nAs Length of the ICC Dynamic Data Maximum Length of Data Expected by the TAL in Response to a Case 2 or 4 Command Length Exact Length of Data Available or Remaining in the ICC (as Determined by the ICC) to be Returned in Response to the Case 2 or 4 Command Received by the ICC Length of Response Data Field Longitudinal Redundancy Check Mandatory Milliohm Megohm Most Significant Meters per Second Milliampere Message Authentication Code Maximum Master File Megahertz Minimum ICC Master Key for session key generation Millimetre Month, Day Month, Year Newton Numeric (see section 4.3) Node Address Negative Acknowledgment Nanoampere-second November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations EMV 4.3 Book 3 Application Specification NCA NF NI NIC NIST NPE ns O O/S P P1 P2 P3 PAN PC PCA PCB PDOL pF PI PIC PIN PIX POS pos. PSE PTS R-APDU Length of the Certification Authority Public Key Modulus Norme Française Length of the Issuer Public Key Modulus Length of the ICC Public Key Modulus National Institute for Standards and Technology Length of the ICC PIN Encipherment Public Key Modulus Nanosecond Optional Operating System Parent key for session key generation Parameter 1 Parameter 2 Parameter 3 Primary Account Number Personal Computer Certification Authority Public Key Protocol Control Byte Processing Options Data Object List Picofarad Issuer Public Key ICC Public Key Personal Identification Number Proprietary Application Identifier Extension Point of Service Position Payment System Environment Protocol Type Selection Response APDU November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations R-block RFU RID RSA RST SAD S-block SCA SDA SFI SHA-1 SI SIC SK SW1 SW2 TAC TAL TC TCK TDOL tF TLV TPDU tR TS TSI TTL Receive Ready Block Reserved for Future Use Registered Application Provider Identifier Rivest, Shamir, Adleman Algorithm Reset Source Node Address Supervisory Block Certification Authority Private Key Static Data Authentication Short File Identifier Secure Hash Algorithm 1 Issuer Private Key ICC Private Key Session Key for session key generation Status Byte One Status Byte Two Terminal Action Code(s) (Default, Denial, Online) Terminal Application Layer Transaction Certificate Check Character Transaction Certificate Data Object List Fall Time Between 90% and 10% of Signal Amplitude Tag Length Value Transport Protocol Data Unit Rise Time Between 10% and 90% of Signal Amplitude Initial Character Transaction Status Information Terminal Transport Layer November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.1 Abbreviations EMV 4.3 Book 3 Application Specification TVR UCOL UL V var. VCC VCC VIH VIL VOH VOL VPP VPP WI WTX WWT YYMM YYMMDD Terminal Verification Results Upper Consecutive Offline Limit Underwriters Laboratories Incorporated Volt Variable (see section 4.3) Voltage Measured on VCC Contact Supply Voltage High Level Input Voltage Low Level Input Voltage High Level Output Voltage Low Level Output Voltage Programming Voltage Voltage Measured on VPP contact Waiting Time Integer Waiting Time Extension Work Waiting Time Year, Month Year, Month, Day November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.2 Notations 4.2 Notations '0' to '9' and 'A' to 'F' 16 hexadecimal characters xx Any value A:= B A is assigned the value of B A = B Value of A is equal to the value of B A ≡ B mod n Integers A and B are congruent modulo the integer n, that is, there exists an integer d such that (A – B) = dn A mod n The reduction of the integer A modulo the integer n, that is, the unique integer r, 0 ≤ r < n, for which there exists an integer d such that A = dn + r A / n The integer division of A by n, that is, the unique integer d for which there exists an integer r, 0 ≤ r < n, such that A = dn + r Y:= ALG(K)[X] Encipherment of a data block X with a block cipher as specified in Annex A1 of Book 2, using a secret key K X = ALG-1(K)[Y] Decipherment of a data block Y with a block cipher as specified in Annex A1 of Book 2, using a secret key K Y:= Sign (SK)[X] The signing of a data block X with an asymmetric reversible algorithm as specified in Annex A2 of Book 2, using the private key SK X = Recover(PK)[Y] The recovery of the data block X with an asymmetric reversible algorithm as specified in Annex A2 of Book 2, using the public key PK C:= (A || B) The concatenation of an n-bit number A and an m-bit number B, which is defined as C = 2m A + B. Leftmost Applies to a sequence of bits, bytes, or digits and used interchangeably with the term “most significant”. If C = (A || B) as above, then A is the leftmost n bits of C. November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.2 Notations EMV 4.3 Book 3 Application Specification Rightmost H:= Hash[MSG] X ⊕ Y Applies to a sequence of bits, bytes, or digits and used interchangeably with the term “least significant”. If C = (A || B) as above, then B is the rightmost m bits of C. Hashing of a message MSG of arbitrary length using a 160-bit hash function The symbol '⊕' denotes bit-wise exclusive-OR and is defined as follows: X ⊕ Y The bit-wise exclusive-OR of the data blocks X and Y. If one data block is shorter than the other, then it is first padded to the left with sufficient binary zeros to make it the same length as the other. November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.3 Data Element Format Conventions 4.3 Data Element Format Conventions The EMV specifications use the following data element formats: a Alphabetic data elements contain a single character per byte. The permitted characters are alphabetic only (a to z and A to Z, upper and lower case). an Alphanumeric data elements contain a single character per byte. The permitted characters are alphabetic (a to z and A to Z, upper and lower case) and numeric (0 to 9). ans Alphanumeric Special data elements contain a single character per byte. The permitted characters and their coding are shown in the Common Character Set table in Annex B of Book 4. There is one exception: The permitted characters for Application Preferred Name are the non-control characters defined in the ISO/IEC 8859 part designated in the Issuer Code Table Index associated with the Application Preferred Name. b These data elements consist of either unsigned binary numbers or bit combinations that are defined elsewhere in the specification. Binary example: The Application Transaction Counter (ATC) is defined as “b” with a length of two bytes. An ATC value of 19 is stored as Hex '00 13'. Bit combination example: Processing Options Data Object List (PDOL) is defined as “b” with the format shown in section 5.4. cn Compressed numeric data elements consist of two numeric digits (having values in the range Hex '0'–'9') per byte. These data elements are left justified and padded with trailing hexadecimal 'F's. Example: The Application Primary Account Number (PAN) is defined as “cn” with a length of up to ten bytes. A value of 1234567890123 may be stored in the Application PAN as Hex '12 34 56 78 90 12 3F FF' with a length of 8. n Numeric data elements consist of two numeric digits (having values in the range Hex '0' – '9') per byte. These digits are right justified and padded with leading hexadecimal zeroes. Other specifications sometimes refer to this data format as Binary Coded Decimal (“BCD”) or unsigned packed. Example: Amount, Authorised (Numeric) is defined as “n 12” with a length of six bytes. A value of 12345 is stored in Amount, Authorised (Numeric) as Hex '00 00 00 01 23 45'. November 2011 4 Abbreviations, Notations, Conventions, and Terminology 4.3 Data Element Format Conventions EMV 4.3 Book 3 Application Specification var. Variable data elements are variable length and may contain any bit combination. Additional information on the formats of specific variable data elements is available elsewhere. November 2011 EMV 4.3 Book 3 Application Specification 4 Abbreviations, Notations, Conventions, and Terminology 4.4 Terminology 4.4 Terminology proprietary Not defined in this specification and/or outside the scope of this specification shall Denotes a mandatory requirement should Denotes a recommendation November 2011 EMV 4.3 Book 3 Application Specification Part II Data Elements and Commands November 2011 EMV 4.3 Book 3 Application Specification 5 Data Elements and Files An application in the Integrated Circuit Card (ICC) includes a set of items of information. These items of information may be accessible to the terminal after a successful application selection (see section 12 of Book 1). An item of information is called a data element. A data element is the smallest piece of information that may be identified by a name, a description of logical content, a format, and a coding.

5.1 Data Elements Associated with Financial Transaction Interchange The data elements dictionary defined in Annex A includes those data elements that may be used for financial transaction interchange. Data elements not specified in Annex A are outside the scope of these specifications. Any additional data element transmitted in the response to the SELECT command (for example, O/S Manufacturer proprietary data) is placed in the field “FCI Issuer Discretionary Data” (tag 'BF0C'). November 2011

5 Data Elements and Files 5.2 Data Objects EMV 4.3 Book 3 Application Specification 5.2 Data Objects A data object consists of a tag, a length, and a value. A tag uniquely identifies a data object within the environment of an application. The length is the length of the value field of the data object. The value field of a data object may consist of either a single data element or one or more data objects. When a data object encapsulates a single data element, it is called a primitive data object. When a data object encapsulates one or more data objects, it is called a constructed data object. Specific tags are assigned to the constructed data objects with a specific meaning in the environment of an application according to this specification. The value field of such constructed data objects is a context-specific template. Rules for the coding of context-specific data objects and templates are given in Annex B. Upon receipt, the terminal shall parse all the data elements following the rules described in Annex B. The retrieved value fields of the data elements shall be stored in the terminal buffer for possible later use in the application. The terminal shall be capable of correctly interpreting Tag Length Value (TLV) data objects with a length field coded '00' as defined in ISO/IEC 7816. This situation can occur when a data element is personalised on a card without an actual value field. A data element with length '00' shall be treated as not present. The data element length indicated in Annex A reflects the length of the data elements when actually present on the card. Annex A describes the mapping of data elements onto data objects and the mapping of data objects into templates when applicable. Records are templates containing one or more primitive and/or constructed data objects. The mapping of data objects into records is left to the discretion of the issuer. The manner in which data elements are to be used is described in Part III. Annex B defines the tags that are reserved by this specification for EMVCo, the payment systems, and issuers. All ICC applications conforming to this specification shall comply with this coding and allocation scheme in accordance with ISO/IEC 7816-6.

5.2.1 Classes of Data Objects Identification and coding of different classes of data objects are defined in Annex B. The tag definitions specified in that annex are according to ISO/IEC 8825 and the ISO/IEC 7816 series and apply to applications conforming to this specification.

November 2011

EMV 4.3 Book 3 Application Specification 5 Data Elements and Files 5.3 Files 5.3 Files The data objects contained in data files accessible from the ICC are stored in records. The file structure and referencing method depend on the purpose of the file. The following sections describe structures and referencing methods. The layout of the data files accessible from the ICC is left to the discretion of the issuer except for the directory files described in the following section.

5.3.1 Application Elementary Files An Application Elementary File (AEF) in the range 1-10, contains one or more primitive Basic Encoding Rules - TLV (BER-TLV) data objects grouped into constructed BER-TLV data objects (records) according to Annex B. After selecting the application, an AEF in the range 1-10 is referred to only by its SFI as described in section 5.3.2.2. A data file referred to in this specification consists of a sequence of records addressed by record number. The data files referred to by SFIs in the range 1-10 contain only data not interpreted by the card, that is, data that is not used by the card in its internal processes. This file structure is defined as linear. It can be either linear fixed or linear variable according to ISO/IEC 7816-4. The choice is left to the issuer and does not affect the reading of the file according to this specification.

5.3.2 File Referencing A file may be referred to by a name or a SFI depending on its type.

5.3.2.1 Referencing by Name Any Application Definition File (ADF) or Directory Definition File (DDF) in the card is referenced by its Dedicated File (DF) name. A DF name for an ADF corresponds to the Application Identifier (AID) or contains the AID as the beginning of the DF name. Each DF name shall be unique within a given card. November 2011

5 Data Elements and Files 5.4 Rules for Using a Data Object List (DOL) EMV 4.3 Book 3 Application Specification 5.3.2.2 Referencing by SFI SFIs are used for the selection of AEFs. Any AEF within a given application is referenced by a SFI coded on 5 bits in the range 1 to 30. The coding of the SFI is described in every command that uses it. Table 1 describes the assignment of SFIs for an EMV application: Value 1-10 11-20 21-30 Meaning Governed by this specification Payment system-specific Issuer-specific Table 1: Structure of SFI A SFI shall be unique within an application. The coding of SFIs within the range 1 to 10 is used to address AEFs governed by this specification.

5.4 Rules for Using a Data Object List (DOL) In several instances, the terminal is asked to build a flexible list of data elements to be passed to the card under the card’s direction. To minimise processing within the ICC, such a list is not TLV encoded but is a single constructed field built by concatenating several data elements together. Since the elements of the constructed field are not TLV encoded, it is imperative that the ICC knows the format of this field when the data is received. This is achieved by including a Data Object List (DOL) in the ICC, specifying the format of the data to be included in the constructed field. DOLs currently used in this specification include:

  • the Processing Options Data Object List (PDOL) used with the GET PROCESSING OPTIONS command
  • the Card Risk Management Data Object Lists (CDOL1 and CDOL2) used with the GENERATE APPLICATION CRYPTOGRAM (AC) command
  • the Transaction Certificate Data Object List (TDOL) used to generate a TC Hash Value
  • the Dynamic Data Authentication Data Object List (DDOL) used with the INTERNAL AUTHENTICATE command This section describes the rules for constructing a field using a DOL supplied by the card. November 2011 EMV 4.3 Book 3 Application Specification 5 Data Elements and Files 5.4 Rules for Using a Data Object List (DOL) A DOL is a concatenated list of entries, with each entry representing a single data element to be included in the constructed field. The format of each entry is a one- or two-byte tag identifying the desired data object, followed by a one-byte length which represents the number of bytes the field shall occupy in the command data. Only tags representing primitive data objects constructed according to Annex B shall be used in DOLs. The terminal shall complete the following steps to build the constructed field: 1. Read the DOL from the ICC. 2. Concatenate all data elements listed in the DOL. The following rules apply to this concatenation: a. If the tag of any data object identified in the DOL is unknown to the terminal or represents a constructed data object, the terminal shall provide a data element with the length specified and a value of all hexadecimal zeroes. b. If a data object is in the list and is meaningful to the terminal but represents optional static data that is absent from the terminal, the portion of the command field representing the data object shall be filled with hexadecimal zeroes. c. If the length specified in the DOL entry is less than the length of the actual data object, the leftmost bytes of the data element shall be truncated if the data object has numeric (n 1) format, or the rightmost bytes of the data shall be truncated for any other format. d. If the length specified in the DOL entry is greater than the length of the actual data, the actual data shall be padded:  with leading hexadecimal zeroes if the data has numeric format  with trailing hexadecimal 'FF's if the data has compressed numeric (cn 1) format  with trailing hexadecimal zeroes for any other format (an, ans or b including bit combination data 1) e. If a data object is in the list and is meaningful to the terminal but represents data that is not applicable to the current transaction, the portion of the command field representing the data object shall be filled with hexadecimal zeroes. The completed list of data elements shall be concatenated in the sequence in which the corresponding data objects appear in the DOL. 1 See section 4.3 Data Element Format Convention. November 2011 EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.1 Command APDU Format The command Application Protocol Data Unit (APDU) consists of a mandatory header of four bytes followed by a conditional body of variable length, as shown in Figure 1: CLA INS P1 P2 ← Mandatory Header 2 → Lc ← Data Conditional Body Le → Figure 1: Command APDU Structure The number of data bytes sent in the command APDU (C-APDU) is denoted by Lc (length of command data field). The maximum number of data bytes expected in the response APDU is denoted by length of expected data (Le). When Le is present and contains the value zero, the maximum number of available data bytes (up to 256) is expected. When required in a command message, Le shall always be set to '00'.

6.2 Response APDU Format The response APDU format consists of a conditional body of variable length followed by a mandatory trailer of two bytes, as shown in Figure 2: Data SW1 SW2 ← Body → ← Trailer → Figure 2: Response APDU Structure The data field of a response APDU is an object structured as defined in Annex B. The detailed coding of the objects is provided with the commands described in subsequent sub-clauses. 2 CLA = Class Byte of the Command Message INS = Instruction Byte of Command Message P1 = Parameter 1 P2 = Parameter 2 November 2011

6 Commands for Financial Transaction 6.3 Coding Conventions EMV 4.3 Book 3 Application Specification 6.3 Coding Conventions This section defines the coding of the header and the body of the messages (command and response).

6.3.1 Coding of the Class Byte The most significant nibble of the class byte indicates the type of command as shown in Table 2: Hex '0' '8' Any other value Meaning Inter-industry command Proprietary to this specification Outside the scope of this specification Table 2: Most Significant Nibble of the Class Byte A command proprietary to this specification is introduced by the most significant nibble of the class byte set to 8; in other words, the structure of the command and response messages is according to ISO/IEC 7816-4, and the coding of the messages is defined within the context of these specifications. The least significant nibble of the class byte indicates secure messaging and logical channel mechanisms, according to ISO/IEC 7816-4.

November 2011

EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.3 Coding Conventions 6.3.2 Coding of the Instruction Byte The INS byte of a command is structured according to Book 1 section 9.4.1. Table 3 indicates the coding of INS and its relationship to CLA: CLA INS Meaning '8x' '1E' APPLICATION BLOCK '8x' '18' APPLICATION UNBLOCK '8x' '16' CARD BLOCK '0x' '82' EXTERNAL AUTHENTICATE '8x' 'AE' GENERATE APPLICATION CRYPTOGRAM '0x' '84' GET CHALLENGE '8x' 'CA' GET DATA '8x' 'A8' GET PROCESSING OPTIONS '0x' '88' INTERNAL AUTHENTICATE '8x' '24' PERSONAL IDENTIFICATION NUMBER (PIN) CHANGE/UNBLOCK '0x' 'B2' READ RECORD '0x' 'A4' SELECT '0x' '20' VERIFY '8x' 'Dx' RFU for the payment systems '8x' 'Ex' RFU for the payment systems '9x' 'xx' RFU for manufacturers for proprietary INS coding 'Ex' 'xx' RFU for issuers for proprietary INS coding Table 3: Coding of the Instruction Byte Note: Additional INS codes may be assigned in the future by EMVCo using class '8x'. It is strongly recommended that application providers not define proprietary commands in class '8x' when they are to be used in the context of these specifications, so that collision is avoided.

6.3.3 Coding of Parameter Bytes The parameter bytes P1 P2 may have any value

If not used, a parameter byte has the value '00'. November 2011

6 Commands for Financial Transaction 6.3 Coding Conventions EMV 4.3 Book 3 Application Specification 6.3.4 Coding of Data Field Bytes When present, a command APDU message data field consists of a string of data elements. When present, a response APDU message data field consists of a data object or a string of data objects encapsulated in a template according to Annex B.

6.3.5 Coding of the Status Bytes The status bytes SW1 SW2 are returned by the transport layer to the application layer in any response message and denote the processing state of the command. The coding of the status words is structured as illustrated in Figure 3: SW1 SW2 Process Completed Process Aborted Normal Warning Execution Checking ' 9000 ' '62xx' '63xx' '64xx' '65xx' '67xx' to '6Fxx' Figure 3: Structural Scheme of Status Bytes

November 2011

EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.3 Coding Conventions SW1 '90' '62' '63' '63' '69' '69' '69' '6A' '6A' '6A' '6A' SW2 '00' '83' '00' 'Cx' '83' '84' '85' '81' '82' '83' '88' Meaning Normal processing Process completed (any other value for SW2 is RFU) Warning processing State of non-volatile memory unchanged; selected file invalidated State of non-volatile memory changed; authentication failed State of non-volatile memory changed; counter provided by 'x' (from 0-15) Checking errors Command not allowed; authentication method blocked Command not allowed; referenced data invalidated Command not allowed; conditions of use not satisfied Wrong parameter(s) P1 P2; function not supported Wrong parameter(s) P1 P2; file not found Wrong parameter(s) P1 P2; record not found Referenced data (data objects) not found Table 4: Coding of Status Bytes SW1 SW2 The following values of SW1 SW2 are described in Part II of Book 1 as they apply to the Transport Protocol Data Unit (TPDU) and are not returned to the APDU:

  • '61xx': SW2 indicates the number of response bytes still available.
  • '6Cxx': Wrong length Le, SW2 indicates the exact length. SW1 = '6x' or '90' denotes a normal, warning, or error condition coded according to ISO/IEC 7816-4. Other values of SW1 returned by the ICC are not supported by Book 1, Part II. November 2011 6 Commands for Financial Transaction 6.3 Coding Conventions EMV 4.3 Book 3 Application Specification Table 5 shows the coding of the SW1 SW2 status bytes which this specification requires to be returned in response to specific conditions. The card may generate status bytes not listed in this table for error and warning conditions not specified in Part III. APPLICATION BLOCK APPLICATION UNBLOCK CARD BLOCK EXTERNAL AUTHENTICATE GENERATE APPLICATION CRYPTOGRAM GET CHALLENGE GET DATA GET PROCESSING OPTIONS INTERNAL AUTHENTICATE PIN CHANGE/UNBLOCK READ RECORD SELECT VERIFY SW1 '62' '63' '63' '69' '69' '69' '6A' '6A' '6A' '6A' SW2 '83' '00' 'Cx' '83' '84' '85' '81' '82' '83' '88' X X X X X X X X X X X X X Table 5: Allocation of Status Bytes The following convention is used in the table: X = Allowed response code, for which a dedicated action shall be taken or which has a special meaning for an EMV compliant application. The meaning of the action is explained in section 10. November 2011 EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.4 Logical Channels If during transaction processing as described in Part III, the card returns a value for SW1 SW2 other than those specified in Table 5, and no other action is indicated elsewhere in these specifications, the transaction shall be terminated. For example, if the application reads records in a file that contains four records and, in response to the READ RECORD command for record 5, the card returns SW1 SW2 = '6400' instead of SW1 SW2 = '6A83', then the transaction would be terminated. If during the processing of the GET DATA command, defined in section 6.5.7, the card returns an error condition, the terminal shall proceed as indicated in section 10.6.3 (for terminal velocity checking) or in section 6.3.4.1 of Book 4 (for cardholder verification processing). If during the processing of an issuer script command, as defined in section 10.10, the card returns a warning condition (SW1 SW2 = '62XX' or '63xx'), the terminal shall continue with the next command from the Issuer Script (if any). For the EXTERNAL AUTHENTICATE command, SW1 SW2 = '6300' means ‘Authentication Failed’.

6.3.6 Coding of RFU Data The coding of data (bits and bytes) indicated as RFU and marked as 'x' in the tables of the specifications shall be set to zero unless otherwise stated. To allow for migration and support of new functionality, the ICC and the terminal shall not verify the data indicated as RFU.

6.4 Logical Channels A logical channel establishes and maintains the link between an application in the terminal and an application in the card. A card may support more than one logical channel but only the basic logical channel is supported by this specification. This limits to one the number of concurrent applications according to this specification. November 2011

6 Commands for Financial Transaction 6.5 Commands EMV 4.3 Book 3 Application Specification 6.5 Commands This section describes the following APDU command-response pairs:

  • APPLICATION BLOCK (post-issuance command)
  • APPLICATION UNBLOCK (post-issuance command)
  • CARD BLOCK (post-issuance command)
  • EXTERNAL AUTHENTICATE
  • GENERATE APPLICATION CRYPTOGRAM
  • GET CHALLENGE
  • GET DATA
  • GET PROCESSING OPTIONS
  • INTERNAL AUTHENTICATE
  • PIN CHANGE/UNBLOCK (post-issuance command)
  • READ RECORD
  • VERIFY The post-issuance commands shall only be sent using script processing (see section 10.10) and secure messaging as specified in Book 2. November 2011 EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.5 Commands 6.5.1 APPLICATION BLOCK Command-Response APDUs 6.5.1.1 Definition and Scope The APPLICATION BLOCK command is a post-issuance command that invalidates the currently selected application. Following the successful completion of an APPLICATION BLOCK command:
  • An invalidated application shall return the status bytes SW1 SW2 = '6283' (‘Selected file invalidated’) in response to a SELECT command.
  • An invalidated application shall return only an Application Authentication Cryptogram (AAC) as AC in response to a GENERATE AC command.

6.5.1.2 Command Message The APPLICATION BLOCK command message is coded as shown in Table 6: Code CLA INS P1 P2 Lc Data Le Value '8C' or '84'; coding according to the secure messaging specified in Book 2 '1E' '00'; all other values are RFU '00'; all other values are RFU Number of data bytes Message Authentication Code (MAC) data component; coding according to the secure messaging specified in Book 2 Not present Table 6: APPLICATION BLOCK Command Message 6.5.1.3 Data Field Sent in the Command Message The data field of the command message contains the MAC data component coded according to the secure messaging format specified in Book 2.

6.5.1.4 Data Field Returned in the Response Message No data field is returned in the response message.

6.5.1.5 Processing State Returned in the Response Message '9000' indicates a successful execution of the command, whether the application was already invalidated or not. November 2011

6 Commands for Financial Transaction 6.5 Commands EMV 4.3 Book 3 Application Specification 6.5.2 APPLICATION UNBLOCK Command-Response APDUs 6.5.2.1 Definition and Scope The APPLICATION UNBLOCK command is a post-issuance command that rehabilitates the currently selected application. Following the successful completion of an APPLICATION UNBLOCK command, the restrictions imposed by the APPLICATION BLOCK command are removed.

6.5.2.2 Command Message The APPLICATION UNBLOCK command message is coded as shown in Table 7. Code CLA INS P1 P2 Lc Data Le Value '8C' or '84'; coding according to the secure messaging specified in Book 2 '18' '00'; all other values are RFU '00'; all other values are RFU Number of data bytes MAC data component; coding according to the secure messaging specified in Book 2 Not present Table 7: APPLICATION UNBLOCK Command Message 6.5.2.3 Data Field Sent in the Command Message The data field of the command message contains the MAC data component coded according to the secure messaging format specified in Book 2.

6.5.2.4 Data Field Returned in the Response Message No data field is returned in the response message.

6.5.2.5 Processing State Returned in the Response Message '9000' indicates a successful execution of the command, whether the application was previously invalidated or not.

November 2011

EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.5 Commands 6.5.3 CARD BLOCK Command-Response APDUs 6.5.3.1 Definition and Scope The CARD BLOCK command is a post-issuance command that permanently disables all applications in the ICC. The CARD BLOCK command shall disable all applications in the ICC, including applications that may be selected implicitly. Following the successful completion of a CARD BLOCK command, all subsequent SELECT commands shall return the status bytes SW1 SW2 = '6A81' (‘Function not supported’) and perform no other action.

6.5.3.2 Command Message The CARD BLOCK command message is coded as shown in Table 8. Code CLA INS P1 P2 Lc Data Le Value '8C' or '84'; coding according to the secure messaging specified in Book 2 '16' '00'; all other values are RFU '00'; all other values are RFU Number of data bytes MAC data component; coding according to the secure messaging specified in Book 2 Not present Table 8: CARD BLOCK Command Message 6.5.3.3 Data Field Sent in the Command Message The data field of the command message contains the MAC data component coded according to the secure messaging format specified in Book 2.

6.5.3.4 Data Field Returned in the Response Message No data field is returned in the response message.

6.5.3.5 Processing State Returned in the Response Message '9000' indicates a successful execution of the command, whether the card was already blocked or not. November 2011

6 Commands for Financial Transaction 6.5 Commands EMV 4.3 Book 3 Application Specification 6.5.4 EXTERNAL AUTHENTICATE Command-Response APDUs 6.5.4.1 Definition and Scope The EXTERNAL AUTHENTICATE command asks the application in the ICC to verify a cryptogram. The ICC returns the processing state of the command.

6.5.4.2 Command Message The EXTERNAL AUTHENTICATE command message is coded as shown in Table 9: Code CLA INS P1 P2 Lc Data Le Value '00' '82' '00' '00' 8-16 Issuer Authentication Data Not present Table 9: EXTERNAL AUTHENTICATE Command Message The reference of the algorithm (P1) of the EXTERNAL AUTHENTICATE command is coded '00', which means that no information is given. The reference of the algorithm either is known before issuing the command or is provided in the data field.

6.5.4.3 Data Field Sent in the Command Message The data field of the command message contains the value field of tag '91' coded as follows:

  • mandatory first 8 bytes containing the cryptogram
  • optional additional 1-8 bytes are proprietary 6.5.4.4 Data Field Returned in the Response Message No data field is returned in the response message. November 2011 EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.5 Commands 6.5.4.5 Processing State Returned in the Response Message '9000' indicates a successful execution of the command. '6300' indicates ‘Issuer authentication failed’. For further information, see Annex F. November 2011 6 Commands for Financial Transaction 6.5 Commands EMV 4.3 Book 3 Application Specification 6.5.5 GENERATE APPLICATION CRYPTOGRAM Command-Response APDUs 6.5.5.1 Definition and Scope The GENERATE AC command sends transaction-related data to the ICC, which computes and returns a cryptogram. This cryptogram shall either be an Application Cryptogram (AC) as specified in this specification or a proprietary cryptogram. In both cases, the cryptogram shall be of a type specified in Table 10 (for more details, see section 9). This command is also used when performing the Combined DDA/Application Cryptogram Generation (CDA) function as described in Book 2 section 6.6. Type Application Authentication Cryptogram Authorisation Request Cryptogram Transaction Certificate Abbreviation AAC Meaning Transaction declined ARQC TC Online authorisation requested Transaction approved Table 10: GENERATE AC Cryptogram Types The cryptogram returned by the ICC may differ from that requested in the command message according to an internal process in the ICC (as described in section 9).

6.5.5.2 Command Message The GENERATE AC command message is coded as shown in Table 11: Code CLA INS P1 P2 Lc Data Le Value '80' 'AE' Reference control parameter (see Table 12) '00' Var. Transaction-related data '00' Table 11: GENERATE AC Command Message

November 2011

EMV 4.3 Book 3 Application Specification 6 Commands for Financial Transaction 6.5 Commands The reference control parameter of the GENERATE AC command is coded as shown in Table 12: b8 b7 b6 b5 b4 b3 b2 b1 Meaning 0 0 AAC 0 1 TC 1 0 ARQC 1 1 RFU x RFU 0 CDA signature not requested 1 CDA signature requested x x x x RFU Table 12: GENERATE AC Reference Control Parameter 6.5.5.3 Data Fie

Shown in part. Read the original for the full text.