Running scriptgen

The scriptgen tool converts a package contained in a CAP file into a script file. The script file contains a sequence of APDUs in ASCII format suitable for another tool, such as apdutool, to send to the CAD. The CAP file component order in the APDU script is identical to the order recommended by the Virtual Machine Specification, Java Card Platform, Version 3.0.5, Classic Edition. If you have a source release, you can localize data associated with the scriptgen tool.

  1. Enter the following command to run the scriptgen tool :

    scriptgen.bat [options] -hashfile hash-file-path cap-file-path

    The scriptgen.bat file is used to invoke scriptgen and must be run from a working directory of JC_CLASSIC_HOME\bin in order for the code to execute properly. Table 9-1 describes the options that can be used to invoke scriptgen.

Table 9-1 scriptgen Command Line Options  

Option Description


Prints a help message and exits.


CAP file name including the full absolute path.

-hashfile hash-file-path

Fully qualified path and name of the verifier-generated file that contains the hashes for all of the components in the input CAP file.


Suppresses printing of the banner.


Suppresses the output of the CAP Begin and CAP End APDU commands.

-o filename

Output filename (default is stdout).

-package package-name

The name of the package contained in the CAP file. If the CAP file contains components of multiple packages, you must use this option to specify which package to process.


Prints the version number and exits.


The apdutool commands of powerup; and powerdown; are not included in the output from scriptgen.