(sorry dexter , this was intended for the list - someone has to fix the reply-to address of this group)<br><br><div class="gmail_quote">Hi all,<br><br>Tonight I worked on the sim implementation with javacard. I will update this thread with my progress.<br>

<br>A few minutes ago, I completed the most important parts selection and creation code, that allows me to create any directory structure on the card.<br>
There is no security yet, only the highway to what is necessary. Side roads will be added later.<br><br>My implementation has a Master File (MF) and the possibility to create directories (Dedicated Files, DF) like in any unix file system. File identifiers are 2 bytes long (Long identifier or LID). The MF is the tree root, with LID 0x3F00, and DFs can be nested to "any" level.<br>


<br>I have a command to select directories, then create directories inside. this is the equivalence of :<br>
cd / (select MF)<br>
cd ..  (select parent DF)<br>
cd <dir> (select a file with its LID, be it the parent, a brother or a child)<br>
mkdir <dir> (create DF)<br>
<br>Everything related to this is described in ISO7816-4 (creation in ISO7816-9).<br><br>You'll be happy (or not) to find BER-TLV encoded data here, too.<br><br>I'm now focusing on having a ISO7816-4 compliant card applet whose code is separated from the filesystem implementation. This way, I'll be able to quickly switch from the ISO7816-4 commands to the TS 11.11 apdu commands. This is only a matter of what information is returned from the SELECT FILE apdu, and what selection modes are supported.<br>


<br>In the coming day I'll focus on data file (EF) implementation, along with the READ and UPDATE commands.<br>Select commands allowing content browsing are planned too (select first/next child)<br><br>The current code is not in the global git yet, I prefer keeping it in my personal SVN until the first release. However if anyone is interested in looking at the code, I can provide access to it.<br>


Let me say this is quite specific code that will not be usable by everyone. You need skills in javacard, globalplatform and smart cards in general.<br><br>Regards<br>Sebastien<br><br>PS: Guess the format of the current "Card FAT" :-)<br>


<br>idx   ty sf lid  fch  nxt  par<br>0000: 01 00 3F00 0001 FFFF FFFF<br>0001: 01 00 2000 0002 0003 0000<br>0002: 01 00 3000 FFFF 0004 0001<br>0003: 01 00 4000 FFFF FFFF 0000<br>0004: 01 00 5000 FFFF FFFF 0001<br><br>OK, that was easy, just a list of entries forming a tree with "next" "child" and "parent" links. data files have a corresponding data block at the same index in another list.<br>


<br>I can nest just everything I want, and create any number of files (well, atm 256, that is configurable, and the max file size is 32kB, that is fixed by the max array size in javacard - signed short ) until the card is full.<br>


<br>tree corresponding to the list (index:file id):<br>0000:3F00<br>+--- 0001:2000<br>|    +--- 0002:3000<br>|    +--- 0004:5000<br>+--- 0003:4000<br><br>
</div>