Java Reference
In-Depth Information
} finally {
if (ac != null) {
// Close connection
ac.close();
}
}
Of course, you should be prepared to handle exceptions; interruptions can occur,
such as a user ejecting a smart card while in use. When you're finished, you must also
close the connection to release the underlying resources used by the Java VM to connect
to the smart card.
The APDUConnection interface also provides support for enabling, disabling, changing,
and confirming the personal identification number (PIN) that the smart card's owner
uses to authenticate himself before permitting the smart card to perform an operation.
The following methods are used to interact with the user and return a smart card
response after processing a PIN:
changePin : Prompts the user to enter the current PIN for the card and then a new
PIN for the card, and commits the PIN change to the card if appropriate
disablePIN : Prompts the user to enter the current PIN for the card and disables the
need for subsequent identification using a PIN
enablePIN : Prompts the user to enter the current PIN for the card and enables
requiring a PIN for subsequent use of the card
enterPIN : Prompts the user to enter the current PIN for the card and verifies
the PIN
To open an APDUConnection , your application must run with privilege; the privilege
you must specify is javax.microedition.apdu.aid to an arbitrary smart card application
ID, and javax.microedition.apdu.sat to a USIM toolkit. Typically, this permission is only
granted to applications in the operator, manufacturer, or third-party trusted domains.
Communicating with Java Smart Cards Using JCRMI
The APDUConnection provides the lowest level of access to a smart card. This level of access
isn't for the faint of heart; it requires a firm understanding of both smart card fundamen-
tals and the application communication protocol for a specific application on a smart
card. Such an interface is ripe for abstraction, and that's the purpose of JCRMI.
JCRMI uses concepts from Java's RMI architecture to permit access to smart card
operations on Java-enabled smart cards directly using Java (see Chapter 11 for a deeper
 
Search WWH ::




Custom Search