javax.smartcardio无需卡即可传输到NFC USB阅读器 [英] javax.smartcardio transmit to NFC USB reader without card

查看:95
本文介绍了javax.smartcardio无需卡即可传输到NFC USB阅读器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用javax.smartcardio将APDU发送到NFC读取器(例如ACR1222L),而无需实际连接"卡?根据我对API的调查,您只能使用从Card获得以及从CardTerminal上的connect获得的CardChannel发送APDU.但是,如果您尝试在NFC读卡器中没有卡的情况下进行连接,则会收到CardException. 在某些阅读器上,外围设备是使用标准APDU进行控制的. 这样,您似乎无法控制ACR1222先前卡的任何外设.还是我在javax.smartcardio中缺少了什么?

Is it possible to send APDU to the NFC reader (for example ACR1222L) using javax.smartcardio without actual card "connected" ? As per my API investigation, you can send APDU only using CardChannel which you get from Card and that you get from connect on CardTerminal. However, if you try to connect when no card in NFC reader, you get CardException. On some readers, peripherals are controlled using standard APDUs. This way it seems you cannot control any peripheral of the ACR1222 prior card is presented. Or am I missing something in javax.smartcardio ?

推荐答案

好的,伙计们,我们快到了.这是下一代消息:-)方法sendmoveCommand要求与要访问的功能"相关的controlCode.根据ACS规范,我控制ACS外围设备的功能是代码为3500(十进制)的ESCAPE.但是,控制代码由以下内容组成:

Ok guys, we are almost there. This is the message for the future generation :-) Method transmitControlCommand requires controlCode related to the "feature" you want to access. According ACS specifications, my feature to control ACS peripherals is ESCAPE with code 3500 (decimal). However control code is compound of:

FILE_DEVICE_SMARTCARD = 0x310000 命令= 3500 * 4

FILE_DEVICE_SMARTCARD = 0x310000 COMMAND = 3500 * 4

例如结果IOCTL_SMARTCARD_ESCAPE_COMMAND controlCode = 0x310000 + 3500 * 4

e.g. resulting IOCTL_SMARTCARD_ESCAPE_COMMAND controlCode = 0x310000 + 3500 * 4

现在,您的ACS 122x终端将接受该命令.注意,每个终端可能有不同的命令来控制外围设备.

Now, your ACS 122x terminal will accept the command. Note, each terminal may have different COMMAND to control peripherals.

信用:Adrian Stabiszewski(https://github.com/grundid/nfctools)

Credits: Adrian Stabiszewski (https://github.com/grundid/nfctools)

这篇关于javax.smartcardio无需卡即可传输到NFC USB阅读器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆