Reputation: 301
I am working with ISO 7816 card and need to read the file structure of the card starting from the MF and trace all the child files in it.
First I have started with SELECT command to select the MF (3F00) and read its FCP template using CLS:0x00 INS:0xA4 P1:0x00 P2:0x06 Le:0x00
It respond me the SW1:61 SW2:XX information, so then I used GET RESPONSE command with CLS:0x00 INS:0xC0 P1:0x00 P2:0x00 Le:XX and got the response in TLV format with all the FCP parameters setted for that file
Now for selected file i.e MF:3F00, how do I select the immediate childs without knowing its File Identifier one by one and then their corresponding child files to traverse the whole file structure.
My problem is that for file selection when I use P1 as 0x01 (select child DF ) or 0x02 (select EF), it gives me error as 6700 as wrong length as I need to pass the DF/EF identifier, but I dont know the file identifier so where will I be able to read the file identifier of the child file?
Upvotes: 1
Views: 1201
Reputation: 5333
The only choice with standardized functionality is, to loop over all possible file identifiers. If the respones indicates a DF, remember for later recursion and select parent immediately to complete the level. Some proprietary command may exist, which allows a more targeted approach.
In general, I'm not convinced, that knowledge of all existing file IDs is overly helpful, since this does not imply you can do anything with the files. For the next step you need some information anyway and getting that right from the beginning saves the boring work.
Upvotes: 0