简体   繁体   English

PyScard-执行GET RESPONSE后获得的数据的解释是什么?

[英]PyScard - What is the interpretation of the data obtained after executing GET RESPONSE?

I'm trying to figure out the file hierarchy within a contact smart card using pyScard and ISO 7816 commands. 我正在尝试使用pyScard和ISO 7816命令确定联系人智能卡中的文件层次结构。

The first thing I do is selecting the master file (INS = 0xA4) using 我要做的第一件事是使用以下命令选择主文件(INS = 0xA4)

    connection.execute([0x0, 0xA4, 0x0, 0x0, 0x0])

This returns ([ ], 0x61, 0x19) which means I have to run a GET_RESPONSE (INS = 0xC0) command in order to get the answer. 这将返回([],0x61、0x19),这意味着我必须运行GET_RESPONSE(INS = 0xC0)命令才能获得答案。

To do so I run 为此,我跑步

    connection.execute([0x0, 0xC0, 0x0, 0x0, 0x19])

which returns a set of bytes (besides the 0x90 00). 它返回一组字节(0x90 00以外)。

If I understand it correctly, by running the SELECT FILE I've selected the master file but I don't seem to find an interpretation for those bytes that I receive with GET RESPONSE, what does that mean? 如果我正确理解它,那么通过运行SELECT FILE,我已经选择了主文件,但是我似乎找不到对我通过GET RESPONSE收到的那些字节的解释,这是什么意思? How do you interpretate them? 您如何解释它们?

Thanks!! 谢谢!! :) :)

Thanks guidot !! 谢谢吉多

GET RESPONSE has no definition of its own for a card speaking T=0, which you seem to have. 对于您看来具有T = 0的卡片,GET RESPONSE没有自己的定义。 You have to look at SELECT command. 您必须查看SELECT命令。 Its quite clear, that a typical card will return a number of FCIs (file control parameter data objects) wrapped in an 62/64/6F tag in TLV-format, but you have to compare this by looking at the response you receive. 很明显,典型的卡将返回许多FCI(文件控制参数数据对象),它们以TLV格式包装在62/64 / 6F标签中,但是您必须通过查看收到的响应来进行比较。 A card can return something completely proprietary however and still claim to conform to 7816-4. 卡可以返回完全专有的内容,但仍然声称符合7816-4。 Without an OS manual you are out of luck then. 如果没有操作系统手册,那么您会很不走运。

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

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