C H A P T E R  6

Compatibility for Classic Applets

This chapter describes how to generate application module JAR files from classic applets using the Normalizer tool. These application modules contain classic CAP files and provide compatibility for the Java Card 3 platform by enabling classic applets to run on smart cards with implementations of either the Connected Edition or Classic Edition. See Chapter 7 for more information on CAP files.


Generating Application Modules From Classic Applets

Developers use the Normalizer to generate application modules for Java Card 3 Platform classic applets they are creating or from classic applets created for previous versions of the Java Card platform. These application modules contain CAP files and are downloadable on both the Java Card 3 platform Classic Edition and Connected Edition smart cards.

The output from the tool is a classic module that contains the class files, the CAP components of the CAP file, SIO proxies for classic SIOs (if required), and associated classic application descriptors. The input to the tool must be classic CAP files and associated export (EXP) files. If the input files are not classic CAP files, the normalization will fail.

Running the Normalizer

The command line interface for the Normalizer has the following syntax (also see normalize Subcommands in addition of reading this entire section):

normalizer.bat subcommand [options]


Note - The file to invoke the Normalizer is a batch file (normalizer.bat) that must be run from a working directory of JC_CLASSIC_HOME\bin in order for the code to execute properly.


The following is a list of the subcommands for the Normalizer:

normalize Subcommands

Use the normalize subcommand and its options to create the package class files. Options are used with the normalize subcommand to specify input files, export paths, export file names, and output directories.

normalize Subcommand Options

TABLE 6-1 identifies the normalize subcommand options and provides their descriptions.


TABLE 6-1 normalize Subcommand Options

Option

Description

-i file

or

--in file

Specifies the input CAP file name.

-p path

or

--exportpath path

Specifies the path of the export files used by the tool.

-o directory

or

--out directory

(Optional) This the default setting and does not have to be explicitly set. Specifies the output directory that contains the export file.

-k

or

--keepall

Specifies the directory to keep class files, proxy classes, and CAP components. The output format is as follows:

<directory>

/ <application classes>

/ proxy/ [proxy classes]

/ javacard/ *.cap


normalize Subcommand Format

The following is the format of the normalize subcommand. Options in the subcommand are used in the sequence that are presented in TABLE 6-1. In this format example, an input file and an output directory are specified as options:

normalizer.bat normalize  --in file --out directory
normalize Subcommand Example

The following is an example of the normalize subcommand in which an input file (myCAP.cap) is specified as an option:

normalizer.bat normalize -i myCAP.cap

copyright Subcommand

The copyright subcommand displays the detailed copyright notice. There are no options associated with this subcommand.

help Subcommand

The help subcommand displays information about the Normalizer command. Options are used with the help subcommand to specify the information that is displayed about each sub-command.

Normalizer Summary Help

The following command displays summary help about the Normalizer:

normalizer.bat help
normalize Subcommand Help

The following command displays help about the normalize subcommand:

normalizer.bat help normalize