Running maskgen
The file to invoke the maskgen
is a batch file (maskgen.bat
) that must be run from a working directory of JC_CLASSIC_HOME\bin
in order for the code to execute properly.
To run maskgen
:
Table 11-1 Command Line Arguments for the maskgen Tool
Argument | Description |
---|---|
|
Prints a help message. |
generator |
Specifies the generator, the plug-in that formats the output for a specific target platform. The generators are:
In this release, the only supported generator is |
filename |
Any number of Java Card Assembly files can be input to You can also create a text file containing a list of Java Card Assembly file names for a new mask, and prepend an "@" character to the name of this text file as an argument to |
|
Specifies a configuration file, which contains generator-specific settings. For example, the following line maps a native Java Card API method to a native label:
|
|
Generates debug information for the generated mask. This option is available only with the |
|
Suppresses all banner messages. |
|
Specifies the file name output from |
|
Prints the version number of |
Order of Packages on the Command Line
The Java Card Assembly files that can be listed on the command line can belong to API packages, the installer package, or the user's library and applet packages. The Java Card Assembly files that belong to API packages must be listed first on the command line, followed by the Java Card Assembly files belonging to any applets.
If you include the installer package's Java Card Assembly file on the command line, it must be listed after all of the assembly files belonging to API packages and before the assembly files of any other applet packages.
For example:
maskgen -nobanner cref API_package_1.jca .... API_package_n.jca installer_package.jca applet_package_1.jca ... applet_package_n.jca
Version Numbers for Processed Packages
The packages that you specify to generate a mask can import other packages. These imported packages must share the same major and minor version number as the specified packages.
For example, presume that you are using Package A
, version 1.1 to create a mask, and that Package A
imports Package B
, version 1.1. Then you must ensure that Package B
, version 1.1 is listed in the import
component of the Package A
.jca
file.
maskgen Example
This example uses a text file (args.txt
) to pass command line arguments to maskgen
:
maskgen -o mask.c cref @args.txt
where the contents of the file args.txt
is:
first.jca second.jca third.jca
This is equivalent to the command line:
maskgen -o mask.c cref first.jca second.jca third.jca
This command produces an output file mask.c
that is compiled with a C compiler to produce mask.o
, which is linked with the Java Card RE interpreter. Refer to Using the Reference Implementation for more information about this target platform.