Sun Logo

Development Kit User's Guide, Java Card Platform, Version 2.2.2

For the Binary Release with Cryptography Extensions

Java Cardtrademark Platform, Version 2.2.2






Who Should Use This Book

Before You Read This Book

How This Book Is Organized

Related Books

Typographic Conventions

Accessing Sun Documentation Online

Sun Welcomes Your Comments

1. Introduction

Converting Java Language Classes

2. Installation

Prerequisites for Installing the Binary Release

Installing the Development Kit Binaries

Files Installed for the Binary Release

Sample Programs and Demonstrations

3. Development Kit Samples and Demonstrations

The Demonstrations

Directories and Files in the demo Directory

Preliminaries for Rebuilding the Demos

Building Samples

Running the Build Script

Setting Environment Variables

Building the Sample Applets

Preparing to Compile the Sample Applets

Compiling the Sample Applets

Converting the Class Files

Running scriptgen to Generate Script Files

Running the Demonstrations

Demo 1

Demo 2

Running demo2

Demo 3

Java Card RMI Demo

Running the Java Card RMI Demo

Secure Java Card RMI Demo

Running the Secure Java Card RMI Demo

Object Deletion Demo 1

Object Deletion Demo 2

Logical Channels Demo

Demo 2 Cryptography Demo

Photo Card Demo

Transit System Demo

Utility APIs Demo Applet

PIN Protection

Storage of Portfolio

Stock Trading

Get Information On a Stock

Password Biometric Sample Application

How the Biometric Sample Works

SamplePasswdOwnerBioTemplate Class

SamplePasswdBioServer Class

SamplePasswdBioApplet Class

Off-card Tool

Sequence Diagram Of How The Sample Works

How The Biometric API Works

Implementation Notes

SignatureMessageRecovery Demo

Message Recovery Order of Operations

Sample Application

4. Running Applets in an Emulated Card Environment

Preparing to Run Java Card WDE

Setting Environment Variables

Configuring the Applets in the Java Card WDE Mask

Running the Java Card WDE Tool

5. Converting Java Class Files

Setting Java Compiler Options

Generating the CAP File's Debug Component

Running the Converter

Converter Command Line Arguments

Converter Command Line Options

Using Delimiters with Command Line Options

Using a Command Configuration File

File and Directory Naming Conventions

Input File Naming Conventions

Output File Naming Conventions

Verification of Input and Output Files

Creating a debug.msk Output File

Loading Export Files

Specifying an Export Map

6. Viewing an Export File

7. Verifying CAP and Export Files

Verifying CAP Files

Running verifycap

verifycap Command Line Arguments

verifycap Command Line Options

Verifying Export Files

Running verifyexp

verifyexp Command Line Arguments

verifyexp Command Line Options

Verifying Binary Compatibility

Running verifyrev

verifyrev Command Line Arguments

verifyrev Command Line Options

Command Line Options for Off-Card Verifier Tools

8. Generating a CAP File From a Java Card Assembly File

Running capgen

capgen Command Line Options

9. Producing a Text Representation of a CAP File

Running capdump

10. Using the Reference Implementation

Running the C-Language Java Card RE

Installer Mask

Runtime Environment Command Line

Runtime Environment Command-line Options

Obtaining Resource Consumption Statistics

Reference Implementation Limits

Input and Output

Working With EEPROM Image Files

Input EEPROM Image File

Output EEPROM Image File

Same Input and Output EEPROM Image File

Different Input and Output EEPROM Image Files

The Default ROM Mask

11. Using the Installer

Installer Components and Data Flow

Running scriptgen

Installer Applet AID

Setting Default Applets

Downloading CAP Files and Creating Applets

Downloading the CAP File

Creating an Applet Instance

Installer APDU Protocol

APDU Types

APDU Responses to Installation Requests

A Sample APDU Script

Deleting Packages and Applets

How to Send a Deletion Request

APDU Requests to Delete Packages and Applets

APDU Responses to Deletion Requests

Installer Limits

12. Sending and Receiving APDU Commands

Running apdutool

apdutool Examples

Directing Output to the Console

Directing Output to a File

Using APDU Script Files

13. Using Cryptography Extensions

Supported Cryptography Classes

Instantiating the Classes

DES Encryption and Signature Performance Enhancements

Temporary RAM Usage by Cryptography Algorithms

14. Java Card RMI Client-Side Reference Implementation

The Java Card Remote Stub Object

Java Card RMI Client-Side API

Package rmiclientlib

Package clientlib

A. Java Card Assembly Syntax Example

B. CAP File Manifest File Syntax

Sample Manifest File

C. Using the Large Address Space

Programming Large Applications and Libraries

Handling a Package as a Separate Code Space

Storing Large Amounts of Data

Example: The photocard Demo Applet

Notes on the photocard Applet