简体   繁体   English

写入模拟卡Android HCE(主机卡仿真)

[英]Write in a emulated card Android HCE (Host card Emulation)

As the HCE was implemented in the version 4.4, I could not find information of how to write in an emulated card. 由于HCE是在4.4版本中实现的,因此无法找到如何在仿真卡中写入的信息。

The android website has a sample of card emulation and a sample of to read the card, but I could not find information about the possibility of writing in a emulated card and how to do it. Android网站有一个卡片仿真样本和一个读取卡片的样本,但我找不到有关在仿真卡片中写入的可能性以及如何操作的信息。

I am developing a application that will read an emulated card, it will modify the card and write it again. 我正在开发一个将读取模拟卡的应用程序,它将修改卡并再次写入。

Someone know if it's possible and how can I do it? 有人知道这是否可能,我该怎么做?

The question "How [do I] write in a [Android HCE] emulated card?" 问题“如何[我如何]在[Android HCE]模拟卡中写入?” does not really match the concept of Android HCE. 与Android HCE的概念并不完全匹配。

With Android HCE you do not emulate a memory card, hence there is no such thing as writing to/reading from such an emulated card by default. 使用Android HCE,您不会模拟存储卡,因此默认情况下不会写入/读取此类模拟卡。 Instead, you emulate an APDU based smartcard application (note: application , not memory area, not whole card). 相反,您可以模拟基于APDU的智能卡应用程序(注意: 应用程序而不是内存区域, 而不是 整个卡)。 APDUs are commands that you can send to a card (for instance with a PC/SC-compliant contactless smartcard reader). APDU是可以发送到卡的命令(例如,使用符合PC / SC的非接触式智能卡读卡器)。 These commands are then interpreted by your emulated smartcard application (ie your HCE service) and used to generate response messages. 然后,这些命令由您的模拟智能卡应用程序(即您的HCE服务)解释,并用于生成响应消息。

So, to summarize, you define the commands (based on ISO 7816-4 APDU structure) that your application should understand and the response message format (again based on ISO 7816-4 APDU structure) that your application sends back. 因此,总而言之,您可以定义应用程序应该理解的命令(基于ISO 7816-4 APDU结构)以及应用程序发回的响应消息格式(同样基于ISO 7816-4 APDU结构)。

There are some ISO 7816-4 based commands listed in this link: 此链接中列出了一些基于ISO 7816-4的命令:

http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_6_basic_interindustry_commands.aspx

I've based my communication is this commands, mainly in the item 6.6. 我的沟通是基于这个命令,主要在6.6项中。

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

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