A Java Card CAP (Converted Applet) file contains a binary representation of a package of classes that can be installed on a device and used to execute the package’s classes on a Java Card virtual machine. CAP file contents, such as class information, executable bytecodes, linking information, verification information, and so forth. The CAP file format is optimized for a small footprint by using compact data structures and limited indirection. It defines a bytecode instruction set that is based on and optimized from the Java bytecode instruction set. A CAP file is produced by a Java Card converter when a package of classes is converted.
A CAP file can be unzipped. When we unzipped the CAP file, you get the following component:
Header.cap: Contains general information about the CAP file.
Directory.cap: Lists the size of each of the components defined in the CAP file.
Applet.cap: Contains an entry for each of applets defined in the package.
Import.cap: Lists the set of packages imported by the classes in the package.
ConstantPool.cap: Contains an entry for each of the classes, methods,and fields referenced by elements in the Method Component.
Class.cap: Describes each of the classes and interfaces defined in the package.
Method.cap: Describes each of the methods declared in this package exclude interface method declaration.
StaticField.cap: Contains all of the information required to create and initialize an image of all of the static fields defined in the package.
RefLocation.cap: Contains all of the linked information that is used in the Method component
Export.cap: Lists all static elements in the package that may be imported by classes in other packages.
Descriptor.cap: Provides sufficient information to parse and verify all elements of the CAP file.
Debug.cap: Contains all necessary meta data for debugging a package.