简体   繁体   English

使用ACR122安装Java Card applet

[英]Installing Java Card applet using ACR122

I'm a newbie to Java Card technology, and I just started reading about it. 我是Java Card技术的新手,我才刚开始阅读它。 I want to create a smart applet for my card. 我想为我的卡创建一个智能小程序。 My goal is for it to work on card used contactlessly. 我的目标是使其能够在非接触式使用的卡上工作。 I downloaded jar file (GlobalPlatformPro) to install *.cap file on card using NFC Card Reader ACR122. 我下载了jar文件(GlobalPlatformPro),以使用NFC读卡器ACR122在卡上安装* .cap文件。 But unfortunately I got an error: 但不幸的是我遇到了一个错误:

Exception in thread "main" java.lang.IllegalArgumentException: apdu must be at least 2 bytes long
        at javax.smartcardio.ResponseAPDU.check(ResponseAPDU.java:73)
        at javax.smartcardio.ResponseAPDU.<init>(ResponseAPDU.java:67)
        at sun.security.smartcardio.ChannelImpl.transmit(ChannelImpl.java:91)
        at pro.javacard.gp.GlobalPlatform.select(GlobalPlatform.java:203)
        at pro.javacard.gp.GPTool.main(GPTool.java:334)

My first question is, is it possible to write an applet using this reader? 我的第一个问题是,是否可以使用此阅读器编写小程序? And secondly how you would recommend doing this? 其次,您将如何建议您这样做?

The problem is you are trying to upload an applet to a card, which does not support Global Platform nor Java Card. 问题是您正在尝试将小程序上载到不支持Global Platform或Java Card的卡。 Mifare 1K is a simple data storage, it can hold some data you write in using its proprietary API. Mifare 1K是一个简单的数据存储,它可以保存您使用其专有API写入的一些数据。 It cannot run any applets, this card is not "smart". 它不能运行任何小程序,该卡不是“智能”卡。

The error message says the response APDU is shorter than expected. 错误消息指出响应APDU比预期的短。 Mifare responses do not follow ISO7816, the response status consists of just one byte only, although ISO7816 expects at least two byte long status word. Mifare响应不遵循ISO7816,响应状态仅由一个字节组成,尽管ISO7816期望至少有两个字节长的状态字。

Look for another card. 寻找另一张卡。 It should support JCOP, that is the keyword to search. 它应支持JCOP,即要搜索的关键字。

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

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