Java Card APDU format
My last post, about Java Card (the reason I’ve been so busy of late – spending 3 times as much work on my team project as most others, including many nights sleep lost) basically didn’t go over very well the whole format of the commands that you have to put into your script.
This will be base knowledge you will need to know if you are going to be programming java Card and any program which may be interacting with some java card program.
(By the way, if you hadn’t already looked, APDU stands for Application Protocol Data Unit)
Basically the bytes are set up in the format:
CLA INS P1 P2 Lc Datafield Le
CLA: Class byte – this often refers to the actual application
INS: instruction byte – indicates the instruction code associated with the one in the java card program.
P1 & P2 – parameters- if needed for certain things, for instance with verification on a mobile phone, you can have a PIN and then a PUK if locked out. Having the same INS byte and a different parameter would make sense.
Lc- says how many bytes in the data field of the APDU command.
Le- the expected Lc of the response APDU command.
This is pretty easy stuff but you just have to remember it. But it will mean people who don’t know this will give you strange looks if you just tell them about it.
There is probably a lot you need to learn in a (more often than not) short space of time, and I know it sucks, but just get on with it.
I’m just trying to lend some help in this not too well documented programming language, and I personally had a lot of problems just setting up the environments with 2 postgraduates at hand for quite a while.
Hopefully I should be uploading a video soon of setting it up/running a quick program.
I’ve already made the video, but sound/text needs to be added, but it will be in depth, so will be around 20/30 mins long
Anyway, again, if you have any questions, just submit a comment.