Java Reference
In-Depth Information
L ISTING 5.9 Continued
aid 0x1:0x0:0x0:0x0:0x1:0x3:0x1:0x0:0x1
this_package 1
export_class_count 0
export_classes {
We still have to physically transfer the CAP file onto our smart card. Sun's development kit
provides a utility for sending APDUs to the smart card. Our last step will be to create the
APDUs to be sent to the smart card. The installer itself has been implemented as an applet.
Using the follow command, we launch the script generator (the -nobeginend option will avoid
to include the standard “ CAP Begin ” and “ CAP End ” APDU commands that we have to cus-
tomize later).
java -classpath %_CLASSES% com.sun.javacard.scriptgen.Main com\marinilli\b2\c5\
javacard\c5.cap -nobeginend
We obtain the output shown in Listing 5.10, the list of APDU commands (a sequence of bytes)
that define our CAP file.
L ISTING 5.10 The APDU Script Generator Output
Java Card 2.1.2 APDU Script File Builder (version 0.11)
Copyright 2001 Sun Microsystems, Inc. All rights reserved.
// com/marinilli/b2/c5/javacard/Header.cap
0x80 0xB2 0x01 0x00 0x00 0x7F;
0x80 0xB4 0x01 0x00 0x16 0x01 0x00 0x13 0xDE 0xCA 0xFF 0xED 0x01 0x02
0x04 0x00 0x01 0x09 0x01 0x00 0x00 0x00 0x01 0x03 0x01 0x00 0x01 0x7F;
0x80 0xBC 0x01 0x00 0x00 0x7F;
// com/marinilli/b2/c5/javacard/Directory.cap
0x80 0xB2 0x02 0x00 0x00 0x7F;
0x80 0xB4 0x02 0x00 0x20 0x02 0x00 0x1F 0x00 0x13 0x00 0x1F 0x00 0x0E
0x00 0x0B 0x00 0x36 0x00 0x0C 0x00 0x67 0x00 0x0A 0x00 0x13 0x00
0x00 0x00 0x6C 0x00 0x00 0x00 0x00 0x00
0x00 0x01 0x7F;
0x80 0xB4 0x02 0x00 0x02 0x01 0x00 0x7F;
0x80 0xBC 0x02 0x00 0x00 0x7F;
Search WWH ::

Custom Search