Overview | Package | Class | Use | Tree | Deprecated | Index | Help

Java Card
v2.2.2
PREV NEXT | FRAMES NO FRAMES

#

# Java Card v2.2.2 API

This document is the specification for the Java CardTM application programming interface(API), version 2.2.2, which is a subset of the JavaTM programming language.

See:
Description

Core Packages
java.io | Defines a subset of the `java.io` package in the standard Java programming language.
java.lang | Provides classes that are fundamental to the design of the Java Card technology subset of the Java programming language.
java.rmi | Defines the `Remote` interface which identifies interfaces whose methods can be invoked from card acceptance device (CAD) client applications.
javacard.framework | Provides a framework of classes and interfaces for building, communicating with and working with Java Card technology-based applets.
javacard.framework.service | Provides a service framework of classes and interfaces that allow a Java Card technology-based applet to be designed as an aggregation of service components.
javacard.security | Provides classes and interfaces that contain publicly-available functionality for implementing a security and cryptography framework on the Java Card platform.

Standard Extensions
javacardx.apdu | Extension package that enables support for ISO7816 specification defined optional APDU related mechanisms.
javacardx.biometry | Extension package that contains functionality for implementing a biometric framework on the Java Card platform.
javacardx.crypto | Extension package that contains functionality, which may be subject to export controls, for implementing a security and cryptography framework on the Java Card platform.
javacardx.external | Extension package that provides mechanisms to access memory subsystems which are not directly addressable by the Java Card runtime environment(Java Card RE) on the Java Card platform.
javacardx.framework.math | Extension package that contains common utility functions for BCD math and parity computations.
javacardx.framework.tlv | Extension package that contains functionality, for managing storage for BER TLV formatted data, based on the ASN.1 BER encoding rules of ISO/IEC 8825-1:2002, as well as parsing and editing BER TLV formatted data in I/O buffers.
javacardx.framework.util | Extension package that contains common utility functions for manipulating arrays of primitive components - `byte`, `short` or `int`.
javacardx.framework.util.intx | Extension package that contains common utility functions for using `int` components.

This document is the specification for the Java CardTM application programming interface(API), version 2.2.2, which is a subset of the JavaTM programming language.

## API Notes, Java Card Platform, v2.2.2

### Referenced Standards

#### ISO - International Standards Organization

- Information Technology - Identification cards - integrated circuit cards with contacts: ISO/IEC 7816
- Identification cards -- Contactless integrated circuit(s) cards -- Proximity cards: ISO/IEC 14443
- Information Technology - Security Techniques - Digital Signature Scheme Giving Message Recovery: ISO/IEC 9796-2
- Information Technology - Data integrity mechanism using a cryptographic check function employing a block cipher algorithm: ISO/IEC 9797
- Information technology - Security techniques - Digital signatures with appendix: ISO/IEC 14888
- Information technology -- ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER): ISO 8825-1:2002

#### RSA Data Security, Inc.

- RSA Encryption Standard: PKCS #1 Version 2.1
- Password-Based Encryption Standard: PKCS #5 Version 1.5

#### EMV

- The EMV 2000 ICC Specifications for Payments systems Version 4.0
- The EMV '96 ICC Specifications for Payments systems Version 3.0

#### ANSI

- Public Key Cryptography for the Financial Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA): X9.62-1998

#### IEEE

- Standard Specifications for Public Key Cryptography, Institute of Electrical and Electronic Engineers, 2000 : IEEE 1363

#### IETF (Internet Engineering Task Force) - IPSec Working Group

- The Internet Key Exchange ( IKE ) document RFC 2409 (STD 1)

#### IETF (Internet Engineering Task Force) - Network Working Group

- RFC 2104: Keyed-Hashing for Message Authentication
- RFC 1321: The MD5 Message-Digest Algorithm

#### FIPS

- Advanced Encryption Standard (AES): FIPS-197

#### KISA - Korea Information Security Agency

- SEED Algorithm Specification

#### Standard Names for Security and Crypto Packages

- SHA (also SHA-1): Secure Hash Algorithm, as defined in Secure Hash Standard, NIST FIPS 180-1
- SHA-256, SHA-384, SHA-512: Secure Hash Algorithm, as defined in Secure Hash Standard, NIST FIPS 180-2
- MD5: The Message Digest algorithm RSA-MD5, as defined by RSA DSI in RFC 1321
- RIPEMD-160: as defined in ISO/IEC 10118-3:1998 Information technology - Security techniques - Hash-functions - Part 3: Dedicated hash-functions
- DSA: Digital Signature Algorithm, as defined in Digital Signature Standard, NIST FIPS 186
- DES: The Data Encryption Standard, as defined by NIST in FIPS 46-1 and 46-2
- RSA: The Rivest, Shamir and Adleman Asymmetric Cipher algorithm
- ECDSA: Elliptic Curve Digital Signature Algorithm
- ECDH: Elliptic Curve Diffie-Hellman algorithm
- AES: Advanced Encryption Standard (AES), as defined by NIST in FIPS 197
- HMAC: Keyed-Hashing for Message Authentication, as defined in RFC-2104

## Parameter Checking

### Policy

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 Java Card Virtual Machine(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:

- ArithmeticException
- ArrayStoreException
- ClassCastException
- IndexOutOfBoundsException
- ArrayIndexOutOfBoundsException
- NegativeArraySizeException
- NullPointerException
- SecurityException

### 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. The terms "Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform. 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

Java Card
v2.2.2
PREV NEXT | FRAMES NO FRAMES

Copyright © 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,
Santa Clara, CA, 95054, U.S.A. All Rights Reserved.