Slide 10
How do you talk to a smartcard? - (4) Using APDUs with pay
Issue APDUs from pay to read the purse file in your M-Card.
- Select the purse file. The purse file is
3f.00/02.00/02.01. This file can be selected by issuing
Select File APDUs from the root directory to the leaf.
pay> ic 00 a4 00 00 02
Enter 2 data bytes (hex):
3f 00
90 00 ok
pay> ic 00 a4 00 00 02
Enter 2 data bytes (hex):
02 00
90 00 ok
pay> ic 00 a4 00 00 02
Enter 2 data bytes (hex):
02 01
90 00 ok
- Read the purse file. You have to issue the Read Record APDU to
do this. The record size of the purse file is 6 byte.
pay> oc 00 b2 0 0 06
1:0 2:3 3:0 4:0 5:0 6:64
90 00 ok
The last 4 byte of the record represents the amount of money stored in
M-Card, in cents. Because mine has $1, it says 0x64 - 100 cents.