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 and CAP files can be input to You can also create a text file containing a list of Java Card Assembly and CAP 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 |
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. CAP files for the user's library or applet packages may also be provided on the command line. The Java Card Assembly files that belong to API packages must be listed first on the command line, followed by the Java Card Assembly or CAP 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 or CAP files of any other applet packages. If a Java Card CAP file is listed on the command line, the export files needed to verify the CAP file by the verifier must also be listed on the command line.
For example:
maskgen -nobanner cref API_package_1.jca .... API_package_n.jca installer_package.jca applet_package_1.jca ... applet_package_n.jca applet_package_a.CAP applet_package_a.exp lang.exp framework.exp
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.
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.