Converting .class file to .cap JavaCard 3.0.2 Connected Edition
I want to use a new api function like strings, streams, longs, etc. I am struggling to convert the class file to cap file, when I include Strings in my code, the converter gives me errors: msgstr "unsupported constant of type String". When I remove the String, the converter converts it to a cap file without error. Is there something extra I need to do to convert .class to .cap to use the connected api?
Usage: JavaCard302 and jdk1.6u11
wrote a bat file that does my compilation and conversion:
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
source to share
CAP files are for classic applets only. Connected applets are servlets packaged in JAR files.
JavaCard classic edition supports a very limited subset of Java. In particular, strings are not supported. This is why the CAP converter rejects your code.
As far as I know, connected publishing is a dead technology. The smart card product does not support it.
The reason is that it was designed to support large SIM cards with a lot of memory and high bandwidth interfaces (USB, MMC), but they never got around. SIM cards or Secure Elements are still very limited today.
source to share
Javacard only supports the keywords below, this is only a subset of Java. default annotation if this private boolean do implements protected throw break else import public throws byte extends instanceof return try case final int short void final interface class for new super switch continue package goto
source to share