demo · v143 · capabilities
APDU builder
An ISO 7816-4 APDU encoder + decoder you can use without a card. Build a command APDU (CLA, INS, P1, P2, data, Le), see the canonical hex on the wire, parse status words back into human text. Six common APDU presets included — SELECT_AID, GET_RESPONSE, READ_BINARY, VERIFY_PIN, MANAGE_CHANNEL, INTERNAL_AUTHENTICATE.
Origin trial / behind a flag: the Web Smart Card API ships behind
chrome://flags/#web-smart-card-api in Chrome 143. This page is the encoder/decoder you'd
pair with a connection to pump APDUs over.
Preset commands
Command header
CLA
Class — 00 = ISO standard, 80+ = proprietary, 0C = secure messaging.
INS
Instruction — A4=SELECT, B0=READ BINARY, 20=VERIFY, C0=GET RESPONSE.
P1
Parameter 1 — SELECT mode (04=by AID), or high offset.
P2
Parameter 2 — SELECT options, low offset.
Data field (hex, no spaces)
Le
Expected response length. 00 = up to 256 bytes. Leave blank for "no response".
Encoded APDU on the wire
Response decoder
Paste response hex (data + SW1 SW2)
APDU format on the wire
- Header (4 bytes): CLA, INS, P1, P2.
- Lc (optional): length of command data.
- Data (Lc bytes): the command payload.
- Le (optional): max expected response length.
- Response: data (variable) + SW1 SW2 (2 bytes status word).
const apduBytes = new Uint8Array([0x00, 0xA4, 0x04, 0x00, 0x07,
0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10, 0x00]);
const response = await connection.transmit(apduBytes);
const sw1 = response[response.length - 2];
const sw2 = response[response.length - 1];
const data = response.subarray(0, -2);