简体   繁体   English

如何读写智能卡

[英]How to read or write smart card

Im new with smart card. 我是智能卡新手。 I have some smart card (ISO 7816-4 support) but don't have the specification and omnikey reader. 我有一些智能卡(支持ISO 7816-4),但没有规范和多功能读取器。 Im using pcsc sharp. 我正在使用pcsc Sharp。 I can transmit only get challenge instruction successfully. 我只能成功传送获取挑战指令。 I can read the ATR too. 我也可以阅读ATR。 One of my card ATR is 3B-DB-94-00-80-31-FE-45-00-31-C0-64-20-27-02-00-00-90-00-45. 我的卡ATR之一是3B-DB-94-00-80-31-FE-45-00-31-C0-64-20-27-02-00-00-90-00-45。 But cannot transmit any other instruction. 但是不能传输任何其他指令。 The response that is getting by sw1 and sw2 is like "file not found", "Wrong parameter" and so on. sw1和sw2得到的响应就像“找不到文件”,“错误的参数”等等。 My question is Is there any common way to read or write on a smart card. 我的问题是,是否有任何常见的方式可以在智能卡上进行读写。 And Can I read or write to a smart card that vendor specification is not known. 我可以读写未知供应商规格的智能卡吗?

Try these Apdu's 试试这些Apdu的

Select MF APDU : 选择MF APDU:

00 A4 00 00 00 00 A4 00 00 00

Create EF APDU(Transmit binary file with File ID 0X3F01) : 创建EF APDU(传输二进制文件,文件ID为0X3F01):

00 E0 00 00 09 62 07 83 02 3F 01 82 01 01 00 E0 00 00 09 62 07 83 02 3F 01 82 01 01

Write Data APDU (data - 0102030405): 写入数据APDU(数据-0102030405):

00 D0 00 00 05 00 D0 00 00 05

Read 5 byte data: 读取5字节数据:

00 B0 00 00 05 00 B0 00 00 05

There is an SDK provided on the web, It's specifically for dot NET 网上提供了一个SDK,专门用于点NET

Here http://www.smartcard-api.com/download.shtml 在这里http://www.smartcard-api.com/download.shtml

You can download the complete code from the above link which in response gives you the card ATR and UID values 您可以从上面的链接下载完整的代码,作为响应,它会为您提供卡的ATR和UID值

I could able to read the card values, still looking to how to write data to contactless cards. 我能够读取卡的值,但仍在寻找如何将数据写入非接触式卡。

Most of smart cards follows the global platform standard nowadays, even internally it may not be a java card. 如今,大多数智能卡都遵循全球平台标准,即使在内部也可能不是Java卡。

So you need know the key to authenticate the card, and use some global platform based tool to access card. 因此,您需要知道用于对卡进行身份验证的密钥,并使用一些基于全局平台的工具来访问卡。

One option tool like: 一种选择工具,例如:

https://github.com/martinpaljak/GlobalPlatformPro https://github.com/martinpaljak/GlobalPlatformPro

There is another javascript based shell that you can use to do some interactive scription: 还有另一个基于javascript的shell,您可以用来做一些交互式的描述:

http://www.openscdp.org/scsh3/ http://www.openscdp.org/scsh3/

Basically, you need know what kind of data and command you need to modify data, and what type of authentication you need do before execute further operation. 基本上,您需要了解修改数据所需的数据类型和命令以及执行进一步操作之前需要执行的身份验证类型。

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

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