简体   繁体   English

在不知道文件标识符的情况下读取 SmartCard ISO 7816 的文件结构

[英]Read file structure of SmartCard ISO 7816 without knowing the file identifier

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.我正在使用 ISO 7816 卡,需要从 MF 开始读取卡的文件结构并跟踪其中的所有子文件。

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首先,我从 SELECT 命令开始到 select MF (3F00) 并使用 CLS:0x00 INS:0xA4 P1:0x00 P2:0x06 Le:0x00 读取其 FCP 模板

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它响应我 SW1:61 SW2:XX 信息,然后我使用 GET RESPONSE 命令和 CLS:0x00 INS:0xC0 P1:0x00 P2:0x00 Le:XX 并获得 TLV 格式的响应,并设置了所有 FCP 参数文件

Now for selected file ie 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.现在对于选定的文件,即MF:3F00,我如何select在不知道其文件标识符的情况下将其直接子文件一一知道其对应的子文件以遍历整个文件结构。

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?我的问题是,对于文件选择,当我使用 P1 作为 0x01(选择子 DF)或 0x02(选择 EF)时,它给我的错误是 6700 错误长度,因为我需要传递 DF/EF 标识符,但我不知道文件标识符,那么我在哪里可以读取子文件的文件标识符?

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.如果响应指示 DF,请记住以后的递归和 select 父级立即完成关卡。 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.一般来说,我不相信所有现有文件 ID 的知识过于有用,因为这并不意味着您可以对文件做任何事情。 For the next step you need some information anyway and getting that right from the beginning saves the boring work.对于下一步,无论如何您都需要一些信息,并且从一开始就正确获取信息可以节省无聊的工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM