A quick and simple javacard applet that helps demonstrating the behaviour of some smart cards. It targets ISO/IEC 7816 command cases 1 to 4.
4 generic instructions are defined:
INS
=C1
handles the incoming command as a command case 1 (noLc
, noLe
)INS
=C2
handles the incoming command as a command case 2 (noLc
, withLe
)INS
=C3
handles the incoming command as a command case 3 (withLc
, noLe
)INS
=C4
handles the incoming command as a command case 4 (withLc
andLe
)
They aim at remembering the incoming APDU buffer, Lc
and Le
values for further use. They won't do anything more. Instructions C2
and C4
send back the APDU buffer content in the UDR
field.
3 dedicated instructions are also defined as command case 2 commands:
INS
=CB
retrieves the last stored APDU buffer contentINS
=CC
retrieves the last value ofLc
fieldINS
=CE
retrieves the last value ofLe
field
A last instruction is defined as a command case 2 command:
INS
=C5
returns the value of the transmission protocolT
in use
This applet can be used with the LINQPad script defined in this gist (this is my test case).
- IDE used: JCIDE
- The applet can also be built using Apache ant
- Minimum Java Card version:
2.1.2
- Applet AID:
F0 01 02 03 04 05
(because why not?)