简体   繁体   English

在JavaCard上安装扩展小程序

[英]Install extended applet on JavaCard

How can I deploy an extended Java-Card-applet to my card? 如何将扩展的Java卡小程序部署到卡上? Until now I've only dealt with classic applets and installed them with GlobalPlatformPro under OS X. 到目前为止,我只处理经典的applet,并在OS X下将它们与GlobalPlatformPro一起安装。

However, when I try to install an extended applet (using gp -install KCIdentity.eap ) it fails with the following message: 但是,当我尝试安装扩展小程序(使用gp -install KCIdentity.eap )时,失败并显示以下消息:

Exception in thread "main" java.lang.RuntimeException: Could not figure out the package name of the applet!
at pro.javacard.gp.CapFile.<init>(CapFile.java:94)
at pro.javacard.gp.CapFile.<init>(CapFile.java:65)
at pro.javacard.gp.GPTool.main(GPTool.java:441)

Does anyone know how I can deploy my applet to my card (ideally using OS X, but Debian or Windows is also OK)? 有谁知道如何将小程序部署到卡上(理想情况下使用OS X,但也可以使用Debian或Windows)?

Edit: Link to GlobalPlatformPro: https://github.com/martinpaljak/GlobalPlatformPro 编辑:链接到GlobalPlatformPro: https : //github.com/martinpaljak/GlobalPlatformPro

Update: This has nothing to do with extended APDUs but with the Java-VM-version. 更新:与扩展的APDU无关,而与Java-VM版本无关。 Classic applets use version 2.x whereas extended applets use version 3.y. 经典小程序使用版本2.x,而扩展小程序使用版本3.y。 NetBeans packages the extended applets in an *.eap-file which doesn't seem to be supported... However I'll look if I can package it in an *.cap-file. NetBeans将扩展的applet打包在一个似乎不受支持的* .eap文件中。但是,我将查看是否可以将其打包在一个* .cap文件中。 Renaming didn't work... 重命名不起作用...

I guess with "extended applet" you are refering to an applet that Extended Length APDUs. 我猜用“扩展小程序”指的是扩展长度APDU的小程序。 To use extended length APDUs the Applet must implement the ExtendedLength interface fomr the standard javacard package. 要使用扩展长度的APDU, Applet必须在标准javacard包中实现ExtendedLength接口。 Otherwise the applet will return with 0x6700 to extended Length APDUs. 否则,小程序将以0x6700返回扩展长度APDU。

However, GP says that the package name could not be determined, so I suppose you did not properly convert/compile the CAP file. 但是,GP说无法确定软件包名称,因此我想您没有正确转换/编译CAP文件。 Therefore you should review your compilation process. 因此,您应该查看编译过程。

I suppose the .eap is a typo? 我想.eap是一个错字? Otherwise change that to .cap , which is the standard format for downloading applets to the card. 否则,请将其更改为.cap ,这是将小程序下载到卡上的标准格式。

edit: answer in the comments. 编辑:在评论中回答。

edit: the reason turned out to be that the card does not support the connected edition. 编辑:原来的原因是该卡不支持所连接的版本。 Javacard3 is divided into classic edition(basically an update on the Javacard 2.2.2 API) and the connected edition(new mechanisms like Webserver applets etc...). Javacard3分为经典版(基本上是Javacard 2.2.2 API的更新)和连接版(新的机制,例如Webserver applet等)。

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

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