Payment Certification Levels
A practical guide to EMVCo L1 / L2 / L3 terminal certifications, PCI DSS merchant compliance tiers, and the standards that govern every card-present transaction.
APDU Protocol & Interaction Specification
Application Protocol Data Units (APDUs) are the message format used between a terminal (or reader) and an ICC (or SE). Defined in ISO 7816-4, they underpin every EMV command from SELECT through GENERATE AC. This reference covers structure, protocol layer differences (T=0 / T=1), every EMV command, the full contact transaction APDU sequence, and all ISO 7816 status words.
APDU Message Structure
APDU Command Cases
CLA Byte Breakdown (ISO 7816-4)
00 = ISO/IEC · 01 = Future · 10 = Future · 11 = Proprietary
0 = No SM · 1 = SM
0 = Last/only · 1 = More C-APDUs
0000–0011
Protocol Layers — T=0 vs T=1
- Level: Character-oriented (byte-at-a-time). Each byte is individually acknowledged.
- APDU Case 4: Not natively supported. Card sends SW1=61 xx after command data, terminal must issue GET RESPONSE (INS C0) to retrieve response data.
- Error detection: Single-byte parity. Repeat transmission on error.
- Guard time: Extra inter-byte gap defined by TC1 in ATR.
- ATR TA1: Encodes clock rate conversion (Fi/Di) factor.
- Usage: Most EMV contact cards. Mandated by Visa, Mastercard chip specs.
- Max speed: Typically 9.6–115 Kbps depending on Fi/Di factors.
- Level: Block-oriented. Each block = Prologue (NAD PCB LEN) + Information field + Epilogue (LRC or CRC).
- APDU Case 4: Native support — full APDU in a single round-trip.
- Error detection: LRC (XOR of bytes) or CRC-16 per block.
- Chaining: Large APDUs split across multiple I-blocks using PCB chain bit.
- Supervision blocks: R-block (ready/error), S-block (resync, abort, WTX request).
- Usage: SIM cards, newer high-security chips, some EMV cards for contactless bridging.
- Max block size: Up to 254 bytes information field (IFSC negotiated via ATR TA3).
ATR — Answer to Reset
The card's first response after reset. Conveys protocol parameters, supported protocols, and historical bytes.
EMV Command Reference
| Command | CLA | INS | P1 / P2 | Data / Le | Response data | Purpose |
|---|---|---|---|---|---|---|
| Application Selection | ||||||
| SELECT | 00 | A4 | 04 00 | Data = AID bytes (5–16 B); Le = 00 | FCI template (6F): label (50), PDOL (9F38), language (5F2D), AID (84) | Select payment application or PSE/PPSE by AID or name |
| GET RESPONSE | 00 | C0 | 00 00 | Le = SW2 from preceding 61 xx | Buffered response data from T=0 Case 4 command | T=0 only: retrieve data card held after responding with 61 xx |
| Transaction Initiation | ||||||
| GET PROCESSING OPTIONS | 80 | A8 | 00 00 | PDOL response data (terminal data matching PDOL template); Le = 00 | Tag 77 (or 80 simplified): AIP (82) + AFL (94) | Initiate transaction; card returns Application Interchange Profile and Application File Locator |
| READ RECORD | 00 | B2 | Rec# / (SFI<<3)|04 | No data; Le = 00 | Tag 70 with record contents (PAN, expiry, CVM List, CDOL, certs…) | Read a record from an EF referenced by AFL (SFI encoded in P2 bits 7–3) |
| GET DATA | 80 | CA | Tag high / Tag low | No data; Le = 00 | Requested tag value (e.g. ATC 9F36, PIN try counter 9F17, log entry 9F4D) | Retrieve a single data object not returned by READ RECORD (ATC, log format, counters) |
| Offline Data Authentication | ||||||
| INTERNAL AUTHENTICATE | 00 | 88 | 00 00 | Lc = len; Data = DDOL response (UN 9F37 + optional other data) | Tag 77: Signed Dynamic Auth Data (9F4B) — ICC private key signature | DDA: card signs UN with ICC private key; terminal verifies with ICC public key |
| PIN Verification | ||||||
| VERIFY | 00 | 20 | 00 / PIN format | Lc = 08; Data = PIN block (Fmt 0 plaintext, Fmt 01 encrypted with ICC PK) | No data; SW=9000 or 63Cx (x = remaining tries) or 6983 (blocked) | Offline PIN verification — plaintext or enciphered PIN block compared against stored reference |
| GET CHALLENGE | 00 | 84 | 00 00 | No data; Le = 08 | 8-byte Unpredictable Number — used as challenge for DDA, online PIN, and GENERATE AC | Obtain 8-byte card-generated random challenge (replaces terminal UN in some flows) |
| Cryptogram Generation | ||||||
| GENERATE AC | 80 | AE | P1: 80=ARQC 40=TC 00=AAC / 00 | CDOL1 (1st GAC) or CDOL2 (2nd GAC) response data; Le = 00 | Tag 77: CID (9F27), AC (9F26), ATC (9F36), IAD (9F10). CDA: also SDAD (9F4B). | Request ARQC (online), TC (offline approve), or AAC (decline). Second call for script confirmation. |
| Issuer Authentication | ||||||
| EXTERNAL AUTHENTICATE | 00 | 82 | 00 00 | Lc = 08; Data = ARPC (8 bytes from issuer) | No data; SW=9000 (ARPC valid) or 6988 (ARPC failed) | Card verifies ARPC using SK-AC; confirms issuer authenticated the transaction |
| Issuer Scripts (CLA=84, Secure Messaging) | ||||||
| PIN CHANGE / UNBLOCK | 84 | 24 | P1: 00=unblock 01=change 03=both | New PIN block (SK-SMC encrypted) + MAC (SK-SMI); Le absent | No data; SW=9000 | Change PIN reference, reset PIN try counter, or both — PIN encrypted with SK-SMC |
| APPLICATION BLOCK | 84 | 1E | 00 00 | MAC (SK-SMI, 8 bytes) | No data; SW=9000 | Block specific application on card; card refuses future transactions for this AID |
| APPLICATION UNBLOCK | 84 | 18 | 00 00 | MAC (SK-SMI, 8 bytes) | No data; SW=9000 | Re-enable a previously blocked application |
| CARD BLOCK | 84 | 16 | 00 00 | MAC (SK-SMI, 8 bytes) | No data; SW=9000 | Permanently block the entire card — cannot be reversed |
| PUT DATA | 84 | DA | Tag high / Tag low | New data value (MAC or SM-protected per tag); Le absent | No data; SW=9000 | Write a single data element — update limits, counters, or application data |
Contact EMV Transaction — Full APDU Sequence
Exact APDU exchange for a typical online-authorized contact transaction with issuer script processing. Arrow direction shows sender.
ISO 7816 Status Words (SW1 SW2)
The table above covers the status words you hit most often in EMV flows. For the full ISO 7816 / EMV list (200+ codes) with an instant SW1 SW2 decoder, see the APDU Response Codes tool.
APDU Command Builder
Select a command, fill in the parameters, and get the formatted hex string to use in your terminal or test harness.
Related Tools
Use these tools to work with the cryptographic primitives that underpin terminal and card security.