Before building a custom RI, the software listed in Prerequisites to Installing the Development Kit must be installed on the system. This section describes the basic step you must follow when creating a custom RI.
To build a custom RI:
Convert your packages using the Converter tool and generate Java Card Assembly files.
Converting and Exporting Java Class Files provides a detailed description of using the Converter tool.
For example, the output Java Card Assembly (
.jca) files could be located at:
Add the location for the Java Card Assembly files for your new packages in these files:
This step is required for new packages. If you are modifying existing packages, this step is not required.
cref is built with the new packages masked in. Masked applications can be instantiated without requiring download after the runtime environment starts up.
Test the custom RI.
The following procedure builds the 32-bit version of the RI. To build the 16-bit version see Building the 16-Bit Custom RI.
To build the 32-bit custom RI:
srcfolder and run the
ant all command creates the
JC_CLASSIC_HOME\custom_build folder with a
lib folder under it.
custom_build\bin directory contains the new
cref and all of the other
.bat files for the tools.
custom_build\lib folder contains the .
jar files and configuration files.
To test the 32-bit custom RI:
creffile stored in JC_CLASSIC_HOME\
custom_build\binnoting the expected console output in Example 12-1 and its specific reference in the content to the
32-bit Address Space.
See Using the Reference Implementation for a description of the available options for
Files created as a result of running or building the custom RI are stored in the JC_CLASSIC_HOME\
custom_build\bin and JC_CLASSIC_HOME\
custom_build\lib directories. These directories are created the first time the custom RI is built and are over-written every time the custom RI is built.
apdutoolin a separate window to send in your apdu scripts to
apdutool -nobanner -noatr filename.scr > filename.scr.cref.out
For information on
apdutool, see Running apdutool. If the run is successful, the
.scr.cref.out, is identical to the file filename
Example 12-1 Expected Console Output When Building 32-Bit Custom RI
Java Card 3.0.5 C Reference Implementation Simulator 32-bit Address Space implementation - with cryptography support T=1 / T=CL Dual interface APDU protocol (ISO 7816-4) Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved. Memory configuration - Type Base Size Max Addr RAM 0x0 0xc78 0xc77 ROM 0x2000 0xc800 0xe7ff E2P 0x10020 0xffe0 0x1ffff ROM Mask size = 0x8b3e = 35646 bytes Highest ROM address in mask = 0xab3d = 43837 bytes Space available in ROM = 0x3cc2 = 15554 bytes Mask has now been initialized for use
By default the procedure described in Building the 32-Bit Custom RI builds the 32-bit
cref. To build
cref with 16-bit support you must modify those steps.
Building the 16-bit version creates only one
cref_t0.exe file with no
tdual version, so the resulting
cref.bat file executes only
To build the 16-bit custom RI:
ant all, set this property:
for.bit=16, with the following modified command:
ant -Dfor.bit=16 all
custom_build/bindirectory and watch for the expected output depicted in Example 12-2 noting its specific reference in the content to the
16-bit Address Space.
Example 12-2 Expected Console Output When Building 16-Bit Custom RI
Java Card 3.0.3 C Reference Implementation Simulator 16-bit Address Space implementation - with cryptography support T=0 Extended APDU protocol (ISO 7816-3) Copyright (c) 2010 Oracle Corporation All rights reserved. Use is subject to license terms. Memory configuration Type Base Size Max Addr RAM 0x0 0x600 0x5ff ROM 0x600 0xbc00 0xc1ff E2P 0xc200 0x3be0 0xfddf ROM Mask size = 0x9fb0 = 40880 bytes Highest ROM address in mask = 0xa5af = 42415 bytes Space available in ROM = 0x1c50 = 7248 bytes Mask has now been initialized for use