Java Card 2.1 Platform
Final Revision 1.0

Java CardTM 2.1 Platform API Specification
Final Revision 1.0

This document is the specification for the Java Card 2.1 Application Programming Interface.


java.lang Provides classes that are fundamental to the design of the Java Card technology subset of the Java programming language.
javacard.framework Provides framework of classes and interfaces for the core functionality of a Java Card applet. Provides the classes and interfaces for the Java Card security framework.
javacardx.crypto Extension package containing security classes and interfaces for export-controlled functionality.


This document is the specification for the Java Card 2.1 Application Programming Interface.

Java Card 2.1 API Notes

Referenced Standards

ISO - International Standards Organization

RSA Data Security, Inc.



Standard Names for Security and Crypto

Parameter Checking


All Java Card API implementations must conform to the Java model of parameter checking. That is, the API code should not check for those parameter errors which the VM is expected to detect. These include all parameter errors, such as null pointers, index out of bounds, and so forth, that result in standard runtime exceptions. The runtime exceptions that are thrown by the Java Card VM are:

Exceptions to the Policy

In some cases, it may be necessary to explicitly check parameters. These exceptions to the policy are documented in the Java Card API specification. A Java Card API implementation must not perform parameter checking with the intent to avoid runtime exceptions, unless this is clearly specified by the Java Card API specification.
Note: If multiple erroneous input parameters exist, any one of several runtime exceptions will be thrown by the VM. Java programmers rely on this behavior, but they do not rely on getting a specific exception. It is not necessary (nor is it reasonable or practical) to document the precise error handling for all possible combinations of equivalence classes of erroneous inputs. The value of this behavior is that the logic error in the calling program is detected and exposed via the runtime exception mechanism, rather than being masked by a normal return.

Submit a bug or feature

Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.