CITI Previous | Index | Next

Exercise 5: Create a File

You can create your own files on the card and set the acl so that only you can read them.

Send a CreateFile APDU to the card, with an acl that gives all rights to everyone.

INS: e0
P1: 0
P2: 0
P3: 10

16 bytes of data accompany the APDU. The first two bytes are the size, the next two are the file name (fid), the next is the file type (use 3 for now), then status (1), two bytes of MBZ, and an acl.

sectok> r
sectok> login -d
sectok> apdu e0 0 0 10 0 2d 78 78 3 1 0 0 ff 0 0 0 0 0 0 0
9000 ok
sectok> f /
sectok> ls
/   
0011
xx  
sectok> acl xx
 world: r w x/a inval rehab dec inc 
sectok>

Or you can use the sectok "create" command.

sectok> r
sectok> login -d
sectok> create xy 29
sectok> ls
/   
0011
xx  
xy  
sectok>