Compilation is done by two steps. The first is javac -g (Make sure to use /usr/um/jdk-1.2.2/bin/javac, not /usr/um/bin/javac nor /usr/bin/javac. Also, do not forget -g) on Sun workstation in CAEN labs (or any computer with javac version 1.2 or higher), and the second is mksolo (in /afs/engin.umich.edu/class/w00/eecs598/002/software/bin), which must be run on Linux. We provide a Linux box called snoopy.citi.umich.edu for this purpose. snoopy has afs mounted on it so that you can share files between Sun workstation and snoopy. Try to ssh to snoopy, and let me know if you cannot. If you get the applet compiled, then download it to your Cyberflex Access smartcard. Put your Todos Argos Mini smartcard reader on your workstation's serial port (do not forget the power), insert your card in the reader, and run smartcard command interpretor called pay. You use pay command "jl" to load the applet, and "jp" to select it.
Once the applet is downloaded and selected, you can communicate with the applet with APDUs (APplication Data Unit). Wallet.java (which is in /afs/engin.umich.edu/class/w00/eecs598/002/software/example) takes four types of APDUs, i.e., deposit (03 10), debit (03 20), balance (03 30), and validate PIN (03 40).
When finished communicating with it, use "jq" to unselect the applet, and "ju" to unload it.
Now step-by-step example.
/* First, compile your applet with -g and appropriate class path. */
decoder% /usr/um/jdk-1.2.2/bin/javac -g -classpath /afs/engin.umich.edu/class/w00/eecs598/002/software/class Wallet.java/* login to snoopy.citi.umich.edu, and get AFS token of engin cell */
-> Wallet.class
decoder% ssh snoopy.citi.umich.edu/* (Linux) Then, run mksolo on the .class file and get .bin file */
itoi@snoopy :) /usr/vice/bin/klog itoi@ENGIN.UMICH.EDU
itoi@snoopy :) /afs/engin.umich.edu/class/w00/eecs598/002/software/bin/mksolo -usemap=/afs/engin.umich.edu/class/w00/eecs598/002/software/map/Access.map -v -d Wallet.class/* start pay */
-> Wallet.bin
decoder% /afs/engin.umich.edu/class/w00/eecs598/002/software/bin/pay/* help is available by typing 'h' in pay. */
pay> h/* Pick the serial port. If you put your smartcard to serial port A, type '1'. If it is on port B, type '2'. */
pay> 2/* download "Wallet.bin" to the card */
1:3b 2:16 3:94 4:81 5:10 6:6 7:1 8:81 9:2f /* this is answer to reset */
pay> jl Wallet.bin/* select the applet */
applet file "Wallet.bin"
program ID 77.77 /* program installed in file 3f00/7777 */
container ID 77.78 /* data container installed in file 3f00/7777 */
instance container size 2048
instance data size 1024
AID 7777777777 /* Application ID is 7777777777 */
signature eed461e31de414c1
90 00 ok
pay> jp/* Now applet "Wallet.bin" is ready to take your APDUs. */
select applet
AID 7777777777
90 00 ok
pay> ic 03 40 00 00 04/* check the balance (default value = 0x20) */
Enter 4 data bytes (hex):
00 00 00 00
90 00 ok
pay> oc 03 30 00 00 01/* debit 0x10 */
1:20
90 00 ok
pay> ic 03 20 00 00 01/* check balance. 0x20 - 0x10 = 0x10. :) */
Enter 1 data bytes (hex):
10
90 00 ok
pay> oc 03 30 00 00 01/* unselect and unload the applet */
1:10
90 00 ok
pay> jqThat's it!! You are welcome to modify Wallet.java and play with it. :)
90 00 ok
pay> ju
90 00 ok