简体   繁体   English

将.class文件转换为.cap JavaCard 3.0.2 Connected Edition

[英]Converting .class file to .cap JavaCard 3.0.2 Connected Edition

I want to make use of the new api function such as strings, threads, longs etc...I'm struggling to convert the class file to cap file when I include Strings in my code, the converter gives me errors: "unsupported String type constant". 我想利用新的api函数,如字符串,线程,long等...当我在代码中包含字符串时,我很难将类文件转换为cap文件,转换器给了我错误:“不支持的字符串类型常数“。 When I remove the String, then the converter converts it to a cap file without errors. 当我删除String时,转换器会将其转换为cap文件而不会出错。 Is there something extra I need to do to convert .class to .cap to use the connected api? 有什么额外的东西我需要做。将.class转换为.cap以使用连接的api?

Using: JavaCard302 and jdk1.6u11 使用:JavaCard302和jdk1.6u11

wrote a bat file that does my compiling and converting: 写了一个bat文件来完成我的编译和转换:

echo off

set appName=testCrypt


set targetdir=C:\SC\%appName%\%appName%
rmdir /S /Q %targetdir%


..\JDK1.6\bin\javac.exe -g -d %appName% -classpath ".;%JC_HOME%\lib\api_connected.jar" %appName%.java

..\JavaCard302\bin\converter.bat -i -applet 0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x08:0x09:0x00:0x00 %appName%.%appName% -classdir %appName% -exportpath %JC_HOME%\api_export_files %appName% 0x01:0x02:0x03:0x04:0x05:0x06:0x07:0x08:0x09:0x00 1.0

CAP files are only for classic applets. CAP文件仅适用于经典applet。 Connected applets are servlets packaged in JAR files. 连接的applet是打包在JAR文件中的servlet。

JavaCard classic edition supports a very limited subset of Java. JavaCard经典版支持非常有限的Java子集。 In particular Strings are not supported. 特别是不支持字符串。 This is why the CAP converter is rejecting your code. 这就是CAP转换器拒绝您的代码的原因。

To my knowledge, the connected edition is a dead technology. 据我所知,连接版本是一种死技术。 No smart-card product supports it. 没有智能卡产品支持它。

The reason is that It was developed to support big SIM cards with lots of memory and high bandwidth interfaces (USB, MMC) but these never took up. 原因是它被开发用于支持具有大量内存和高带宽接口(USB,MMC)的大型SIM卡,但这些从未占用过。 Today's SIM cards or Secure Elements are still very limited devices. 今天的SIM卡或安全元素仍然是非常有限的设备。

Javacard只支持下面的关键字,它只是Java的一个子集。抽象默认如果私有这个布尔值实现了保护抛出其他导入公共throws字节扩展instanceof返回try case final int short void catch finally接口static而class为new super switch继续转到包

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

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