Sun Logo


Development Kit User’s Guide

Java Cardtrademark 3 Platform, Version 3.0.2

Connected Edition

12-14-09



Contents

Figures

Tables

Preface

Part I Setup, Samples and Tools

1. Introduction

Platform Architecture

Development Kit Description

Connected Edition Features

Connected Edition Security Model

Application Models

Development Kit Contents

Reference Implementation

Command Line Tools

Samples

System Requirements

Additional Software

Java Card TCK

2. Installation

Prerequisites to Installing the Development Kit

Install and Setup the Development Kit

procedure iconsmall spaceInstalling the Development Kit

procedure iconsmall spaceSetting Up the System Variables

Installed Directories and Files

Directories and Files Installed From All Bundles

Subdirectories and Files Installed in the src Directory

Uninstall the Development Kit

Install and Setup the NetBeans IDE

procedure iconsmall spaceInstalling the NetBeans IDE

procedure iconsmall spaceSetting Up the Java Card Platform

3. Developing Java Card 3 Platform Applications

Development Steps

4. Using the Samples

Running the Samples

procedure iconsmall spaceRunning the Samples from the NetBeans IDE

procedure iconsmall spaceAccepting an Untrusted Certificate

Using the Web Application Sample

Using the HelloWorld Sample

procedure iconsmall spaceRun HelloWorld

Using the Classic Applet Sample

Using the Extended Applet Sample

5. Starting the Java Card Runtime Environment

Starting cjcre.exe from the Command Line

cjcre.exe Command Line Options

Java Card Runtime Environment Configuration Files

Adding Proprietary Packages

6. Compiling Source Code

Running the Compiler Tool from the Command Line

Compiler Tool Options

Format

Examples

7. Creating and Validating Application Modules

Packager Operation

Options

Basic Packaging Sequence

Use Cases

Signing

Use Cases

Running the Packager From the Command Line

create Subcommand

create Subcommand Format

create Subcommand Options

create Subcommand Examples

validate Subcommand

validate Subcommand Format

validate Subcommand Options

validate Subcommand Example

copyright Subcommand

copyright Subcommand Format

copyright Subcommand Options

copyright Subcommand Example

help Subcommand

help Subcommand Format

help Subcommand Options

help Subcommand Example

Use Cases

8. Loading and Managing Applications

Description of the On-Card Installer

On-card Installer Operation

On-card Installer Functionality

Description of the Installer Tool

Running the Installer Tool From the Command Line

load Subcommand

create Subcommand

delete Subcommand

unload Subcommand

list Subcommand

help Subcommand

Card Installer Use Case

Load an Application

Pre-Conditions

Post-Conditions

Sequence of Events

9. Backwards Compatibility for Classic Applets

Generating Application Modules From Classic Applets

Running the Normalizer From the Command Line

normalize Subcommand

copyright Subcommand

help Subcommand

Converting Class Files to CAP Files

Conversion Process Sequence

Specifying an Export Map

Loading Export Files

Creating a debug.msk Output File

Verification of Input and Output Files

File and Directory Naming Conventions

Input File Naming Conventions

Output File Naming Conventions

Running the Converter From the Command Line

converter Command Options

Using a Command Configuration File

Using Delimiters with Command Line Options

10. Using the APDU Tool

Running the APDU Tool From the Command Line

Examples of Using the APDU Tool

Directing Output to the Console

Directing Output to a File

Using APDU Script Files

APDU Script File Commands

APDU Script Preprocessor Commands

11. Debugging Applications

Debugger Architecture

Running the Debugger From the Command Line

debug Subcommand

copyright Subcommand

help Subcommand

Debugging a Java Card 3 Platform Application

Compile the Source Code

Start the Debugger

Attach the Debugger to the IDE

Run cjcre.exe With -debug Option

Set Break Points

Part II Programming With the Development Kit

12. Configuring the RI

Configuring Authenticators

Creating Custom Protection Domains

Creating a Custom Keystore

Configuring SSL Support

Adding SSL Support

Custom Certificates and Keys

procedure iconsmall spaceGenerating an SSL Certificate

13. Building the RI From Sources

Prerequisites to Building the RI

Contents of JC_CONNECTED_HOME\src Folder

Running the ROMizer Tool From the Command Line

romize Subcommand

romize Subcommand Options

romize Subcommand Example

copyright Subcommand

help Subcommand

Apps list File Contents

Example Contents of Apps List File

Romizer Tool Output

Building a Custom cjcre.exe

Preprocessor Symbols to Customize the VM

procedure iconsmall spaceBuild a Custom RI From the Command Line

procedure iconsmall spaceTest the Custom RI

14. Working with APDU I/O

The APDU I/O API

APDU I/O Classes and Interfaces

Exceptions

Two-interface Card Simulation

Examples of Use

To Connect To a Simulator

To Establish a T=0 Connection To a Card

To Power Up And Power Down the Card

To Exchange APDUs

To Print the APDU

A. Application Module and Library Formats

Web Application Module Format

Extended Applet Application Module Distribution Format

Classic Applet Application Module Format

Extension Library Format

Classic Library Format

Glossary

Index