-
Notifications
You must be signed in to change notification settings - Fork 3
Applet Development
(This section assumes that you already know how JavaCard applet development goes on in the big picture - conventions, limitations, conversion etc. If not - head to Fidesmo Developer Portal for more info or contact Fidesmo for support. Please keep in mind that JavaCard is not standard Java and specific knowledge is required to write production-grade JavaCard applets.)
There is no difference which tools are used to generate the CAP file (as long as it passes the off-card verification), but ant-javacard provides probably the easiest experience for both new and existing projects. Proprietary software such as JCOP tools can also be used.
When developing an applet for the Fidesmo ecosystem, the following needs to be kept in mind:
- AID-s in the CAP file must follow the AID conventions of Fidesmo (right prefix with your appId embedded)
- but you can contact Fidesmo for exceptions
- with ant-javacard, specify your appId with
fidesmoappid
and you're all set, all AID-s are generated automatically
- There are different secure elements with different capabilities in the Fidesmo ecosystem, for which separate
CAP files may be needed and in some cases also separate codebases.
- be sure to specify different package AID-s to different CAP files, to make sure that every platform gets the right CAP file and appropriate handling in your service. For example, ant-javacard automatically increases a counter at the end of the pre-defined AID for different CAP files, if built within the same Ant target.
If your project is using Gradle, javacard-cradle-plugin wraps ant-javacard in a convenient way, extending the similar ease of use to the Gradle world.
Here's a sample build.xml
from fidesmo-javacard-example:
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="applet" name="Fidesmo JavaCard example">
<!-- ant-javacard -->
<get src="https://github.com/martinpaljak/ant-javacard/releases/download/18.07.27/ant-javacard.jar" dest="." skipexisting="true"/>
<taskdef name="javacard" classname="pro.javacard.ant.JavaCard" classpath="ant-javacard.jar"/>
<!-- Make applet -->
<target name="applet">
<javacard jckit="sdks/jc305u3_kit">
<cap targetsdk="sdks/jc301_kit" sources="src/main/javacard" fidesmoappid="01020304">
<applet class="com.fidesmo.javacard.example.HelloWorld"/>
<import jar="lib/gp211.jar"/>
</cap>
</javacard>
</target>
</project>
You can find more tunables from ant-javacard documentation. Once you have the applet developed, it is time to test by installing and personalizing it on a Fidesmo device.
For support please contact Fidesmo via support@fidesmo.com