Home > Store > Programming > Java

Java Card™ Technology for Smart Cards: Architecture and Programmer's Guide

Register your product to gain access to bonus material or receive a coupon.

Java Card™ Technology for Smart Cards: Architecture and Programmer's Guide


  • Your Price: $35.99
  • List Price: $44.99
  • Usually ships in 24 hours.


  • Copyright 2000
  • Dimensions: 7-3/8x9-1/4
  • Pages: 400
  • Edition: 1st
  • Book
  • ISBN-10: 0-201-70329-7
  • ISBN-13: 978-0-201-70329-0

Java Card™ technology provides a secure, vendor-independent, ubiquitous Java™ platform for smart cards and other memory constrained devices. It opens the smart card marketplace to third-party application development and enables programmers to develop smart card applications for a wide variety of vendors' products.

This book is the comprehensive guide to developing applications with Java Card technology. It introduces you to the Java Card platform and features detailed discussions of programming concepts. It also provides a step-by-step Java Card applet development guide to get you up and running.

  • Specific topics covered include:
  • Smart card basics
  • Java Card virtual machine
  • Persistent and transient objects
  • Atomicity and transactions
  • Handling APDUs
  • Applet firewall and object sharing
  • Java Card platform security
  • A step-by-step applet development guide
  • Applet optimization guidelines
  • A comprehensive reference to Java Card APIs

With Java Card technology, smart card programming will finally enter the mainstream of application development. This book provides the authoritative and practical information you need to enter this rapidly growing arena.


Sample Content

Table of Contents




1. From the Beginning.

Smart Cards.

Brief History.



Challenges in the Development of Smart Card Applications.

Applying Java to Smart Cards.

Benefits of Java Card Technology.

Brief History of Java Card Technology.

2. Smart Card Basics.

Overview of Smart Cards.

Basic Card Types.

Memory Cards versus Microprocessor Cards.

Contact Cards versus Contactless Cards.

Smart Card Hardware.

Smart Card Contact Points.

Smart Card Central Processing Unit.

Smart Card Coprocessors.

Smart Card Memory System.

Smart Card Communication.

Card Acceptance Device and Host Applications.

Smart Card Communication Model.

APDU Protocol.

TPDU Protocol.


Smart Card Operating Systems.

Smart Card File Systems.

Master File.

Dedicated File.

Elementary File.

Smart Card Systems.

Smart Card Standards and Specifications.

ISO 7816 Standards.



Open Platform.

OpenCard Framework.



3. Java Card Technology Overview.

Architecture Overview.

Java Card Language Subset.

Java Card Virtual Machine.

CAP File and Export File.

Java Card Converter.

Java Card Interpreter.

Java Card Installer and Off-Card Installation Program.

Java Card Runtime Environment.

JCRE Lifetime.

How Does the JCRE Operate during a CAD Session?

Java Card Runtime Features.

Java Card APIs.

java.lang Package.

javacard.framework Package.

javacard.security Package.

javacardx.crypto Package.

Java Card Applets.

Package and Applet Naming Convention.

Applet Development Process.

Applet Installation.

ROM Applets.

Preissuance or Postissuance Applets.

Postissuance Applet Installation.

Error Recovery during Applet Installation.

Installation Constraints.

4. Java Card Objects.

Java Card Memory Model.

Persistent Objects.

Transient Objects.

Properties of Transient Objects.

Transient Object Types.

Creating Transient Objects.

Querying Transient Objects.

A Few Words about Object Creation and Deletion.

5. Atomicity and Transactions.


Block Data Updates in an Array.


Commit Transaction.

Abort Transaction.

Nested Transaction.

Commit Capacity.


Local Variables and Transient Objects during a Transaction.

6. Java Card Exceptions and Exception Handling.

Exceptions in the java.lang Package.

Java Card Exceptions.

Java Card Exception Reason Code.

Throwing an Exception in the Java Card Platform.



7. Java Card Applets.

Applet Overview.

Applet Installation and Execution.

Applet Communication.

Class javacard.framework.Applet.

install Method.

Creating Objects in the Applet's Constructor.

Registering the Applet Instance with the JCRE.

Processing the Installation Parameters.

Further Applet Initialization.

select Method.

SELECT APDU Format and Processing.

Default Applet.

deselect Method.

process Method.

Other Methods in the Class javacard.framework.Applet.

8. Working with APDUs.

APDU Class.

APDU Object.

APDU Buffer Size.

Interface ISO7816.

Working with APDUs in Applets.

Retrieve the APDU Buffer.

Examine the Command APDU Header.

Receive APDU Command Data.

Process the APDU Command and Generate the Response Data.

Return APDU Response Data.

Return the Status Word.

Protocol-Specific APDU Processing.

Method getProtocol.

Method getInBlockSize.

Method getOutBlockSize.

Method setOutgoingNoChaining.

Method getNAD.

Method waitExtension.


9. Applet Firewall and Object Sharing.

Applet Firewall.


Object Ownership.

Object Access.

Transient Array and Context.

Static Fields and Methods.

Object Sharing across Contexts.

Context Switch.

JCRE Privileges.

JCRE Entry Point Objects.

Global Arrays.

Object Shareable Interface Mechanism.

10. Programming Cryptography.

Quick Tour of Cryptography.

Encryption and Decryption.

Message Digest.

Digital Signature.

Random Data.

Cryptographic Practice in Smart Card Applications.

Ensuring Application Security.

Functioning as a Secure Token.


Java Card Cryptography APIs.

Design Principles.


Package Structure.

Code Examples.

Compute a Message Digest.

Build a Cryptographic Key.

Sign and Verify a Signature.

Encrypt and Decrypt Data.

Generate Random Data.

11. Java Card Platform Security.

Java Card Platform Security Features.

Java Language Security.

Additional Security Features of the Java Card Platform.

Java Card Platform Security Mechanisms.

Compile-Time Checking.

Class File Verification and Subset Checking.

CAP File and Export File Verification.

Installation Checking.

Cryptographically Enforced Chain Trust.

Runtime Security Enforcement.

Java Card Cryptographic Support.

Applet Security.


12. Step-by-Step Applet Development Guide.

Design the Applet.

Specify the Functions of the Applet.

Specify AIDs for the Applet.

Define the Class Structure and Method Functions of the Applet.

Define the Interface between the Applet and Its Host Application.

Construct the Applet Code.

Wallet Applet Code.

Implement Error Checking.

What's the Next Step?

13. Applet Optimization.

Optimizing an Applet's Overall Design.

On-Card Execution Time.

Method Invocations.

Creating Objects in Applets.

Reusing Objects.

Eliminating Redundant Code.

Accessing Arrays.

The switch Statement versus the if-else Statement.

Arithmetic Statements.

Optimizing Variables in Applets.

14. Working with int Data Type.

32-Bit Arithmetic Operations.

Array Size and Array Index.

Storing and Computing int Values.


4 Appendices.

A. Java Card Language Subset.
B. Java Card Application Programming Interface.
Bibliography. 0201703297T04062001


Audience for This Book

Java Card™ technology combines a subset of the Java programming language with a runtime environment optimized for smart cards and other memory-constrained devices. This book is intended for a wide technical audience with different needs of understanding Java Card technology.

First and foremost, it is written for Java Card applet developers. You will find a smart card tutorial, in-depth discussions on various Java Card features, helpful programming tips for applet development, and the reference to the Java Card APIs.

Second, this book is supplementary reading for Java Card platform implementors. It provides further discussion of many topics in the Java Card specifications and includes code examples to clarify those topics.

Third, this book is useful for technical managers or anyone who wants to gain an overall understanding of Java Card technology. In particular, the first three chapters are introductions to orient you within the technology from both a technical and marketing point of view.

Throughout this book, I assume that readers are familiar with the fundamentals of the Java language. For those who want to learn more about the Java language, the book by Arnold and Gosling is a good resource.

Organization of This Book

This book is written in a bottom-up fashion. Each chapter was a step to the next one, so it is best if you read the chapters in order.

Part 1: Introduction
  • Chapter 1 introduces smart cards and Java Card technology—history, benefits, and applications.
  • Chapter 2 discusses smart card basics as a foundation for exploring the rest of the book.
Part 2: Java Card Technology
  • Chapter 3 gives an overview of Java Card technology—the system architecture and its components.
  • Chapter 4 discusses the properties and the behavior of persistent and transient objects in the Java Card platform and how to create and use those objects.
  • Chapter 5 explains what atomicity means in the Java Card platform and how to develop an applet using transactions to protect data integrity.
  • Chapter 6 discusses exceptions in the Java Card platform and how applets throw and handle exceptions.
  • Chapter 7 explains how applets run within the JCRE and demonstrates the techniques of applet writing.
  • Chapter 8 describes the techniques of handling APDUs in an applet.
  • Chapter 9 explains the behavior of objects, exceptions, and applets under the control of the applet firewall and discusses how applets can safely share data using object sharing mechanisms.
  • Chapter 10 first introduces many important cryptographic concepts and algorithms. It then outlines the cryptographic APIs in the Java Card platform and demonstrates how to use these APIs through code examples.
  • Chapter 11 describes the security features in the Java Card platform and discusses how these security features are enforced through a variety of mechanisms. Along with the discussion, this chapter summarizes the topics covered in Part 2.
Part 3: Programming Guide and Tips
  • Chapter 12 walks you through a step-by-step process of creating a simple electronic wallet applet.
  • Chapter 13 provides a number of recommendations for optimizing applets. In many cases, a discussion is provided with the recommendation to help you understand various design trade-offs.
  • Chapter 14 discusses issues related to using the int data type when writing Java Card applets.
Part 4: Appendices
  • Appendix A describes the subset of the Java programming language that is supported in the Java Card platform.
  • Appendix B provides a comprehensive reference to the Java Card 2.1 APIs.
The Version Covered in This Book

This book is based on Java Card version 2.1, the latest release when the book was written. At the meantime, the next version 2.1.1 is underway. Version 2.1.1 will include minor enhancement updates to version 2.1. The contents and techniques covered in the book will continue to be relevant to future Java Card releases, and new things will be incorporated in future editions of this book.

Retrieving Additional Information On-line

You can get the latest on Java Card technology or the latest Java Card development kit from the Java Card web site at http://java.sun.com/products/javacard. For updated information about this book, visit http://java.sun.com/books/series/javacard.



Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership