•
A subset of the
package. It supports the exception class
85-.
, which is not included in the CLDC
API or the MIDP API.
•
The
5 5
package. It includes the interface
APDUConnection to support APDU exchanges.
APDUConnection Interface
This interface extends the
5
interface. It defines
the APDU connection. MIDlets can use this connection to communicate with applica-
tions on a smart card using APDU protocol. ISO 7816-4 defines the APDU protocol as
an application-level protocol between a smart card and an application on the device.
There are two types of APDU messages:
•
command APDUs - sent to the smart card by a MIDlet
•
response APDUs - messages received from the smart card
All APDUs is generated according to the ISO 7816-4 specification.
Opening an APDU Connection
An APDU connection is established between a MIDlet and an application on a smart
card. It uses one dedicated logical channel for that connection. The implementation
supports multiple APDU connections between the handset and a smart card. Addi-
tionally it supports multiple APDU connections between a MIDlet and an application
on a smart card (if multiple connections are supported by the application on a smart
card).
A MIDlet uses method
5
to open an APDU
connection. An APDU connection is created by passing a generic connection URI
string with the smart card AID and, optionally, the slot in which the smart card is in-
serted, to the
5
method. When the
method
5
is called by a MIDlet, the im-
plementation requests a new logical channel from the smart card, for the APDU con-
nection, unless channel 0 is used. When method
5
is called by a MIDlet, and the logical
Java ME Developer Guide
Chapter 12 - JSR-177 Java ME Security and Trust Services API
[88/201]
DRAFT - Subject to Change