C H A P T E R  2

Developing Classic Edition Applications

This chapter provides a brief description of the activities and development kit tools involved in developing applications for the Java Card 3 Platform, Classic Edition. See the Application Programming Notes, Java Card Platform, Version 3.0.1, Classic Edition for additional, advanced information not provided in this guide about creating applications for the Java Card 3 platform.


Classic Applet Development Process

Developing and debugging your classic applets can best be handled through the use of an IDE, such as the NetBeans IDE version 6.8. To do so, install the Connected development kit, then the NetBeans IDE. However, before you start developing any new classic applet applications, you might want to see Chapter 4 describing the classic samples in this classic development kit and also read Part II of this book where classic program design issues are described.

If you use the Connected Edition development kit to create your applet application, you can create your Java source code and debug it using the NetBeans IDE. You will also create a CAP file, which is a file distribution format that is a binary representation of a converted Java technology package. Then you will bring your classic applet application’s CAP file back into this development kit. First, install this development kit as described in Chapter 3. Next, starting with Chapter 8, Packaging and Deploying Your Application, you can proceed onward in this book.

If you decide not to use the Connected Edition to develop your classic applet application, the process for developing a new classic applet application consists of first creating your Java code in the IDE of your choice, then debugging it. This version of the classic development kit does not include a tool for debugging your applet application.

When your Java source code is complete and you have compiled it to generate class files, you can then use the tools provided with the development kit to create CAP files that can be downloaded in the classic edition or connected edition simulators or cards. If you have existing CAP files in Java Card platform 2.x format, they can be converted to the 3.0.2 or 3.0.3 CAP file format through the normalization process.

FIGURE 2-1 shows the development and deployment process for classic applet applications using this development kit.

FIGURE 2-1 Process for Classic Applet Development and Deployment


This figure has already been described in text.


Classic Development Kit Tools

The development kit for the Classic Edition consists of a suite of command line tools and samples for designing Java Card technology-based implementations and producing classic applet applications based on the Application Programming Interface, Java Card Platform, Version 3.0.1, Classic Edition.

Using the development kit’s suite of tools is described in Using the Classic Tools and in more detail throughout this book.


Using the Classic Tools

Each classic development kit tool performs a necessary function in producing a classic applet application for the Java Card 3 Platform, Classic Edition, see FIGURE 2-2. An off-the-shelf IDE such as the NetBeans IDE can be used to write and debug your Java classes. Then, the tools in this development kit can be used to package and deploy your classic applet application.

Once you have written your Java programming language source code, it can be converted into a CAP file, packaged, and then sent via APDUs to a Java Card technology-enabled smart card. The data flow starts with Java programming language source being compiled with an IDE and then input to the Converter. The Converter tool can convert classes and any export files that comprise a Java package into a converted applet (CAP) file or into a Java Card technology-based Assembly (Java Card Assembly) file.

A CAP file is a binary representation of converted Java technology package. A Java Card Assembly file is a human-readable text representation of a converted package that you can use to aid testing and debugging. A Java Card Assembly file can also be used as input to the capgen tool to create a CAP file.

CAP files are processed, or “packaged,” by an off-card installer, scriptgen. This produces an APDU script file as input for the deployment process handled by apdutool, which then sends APDUs to the off-card installer on a smart card containing a Java Card RE implementation. The RI can be used as an emulator for a smart card environment.

FIGURE 2-2 Java Card Platform Conversion


This figure was explained before the caption.

Not shown in FIGURE 2-2 is the tool capdump, which produces a simple ASCII version of the CAP file to aid in debugging. Also, the off-card verification tools are not shown.