|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.smartcard.SmartCardReaderSession
Represents a communications session with a physical smartcard reader. Over this session, APDUs may be exchanged with the reader and smartcard to provide the desired functionality.
Sessions should not be held open when not in use. As a security precaution, only one open session is allowed to exist per SmartCardReader,
and subsequent openSession requests will block until the current session is closed.
Note to implementors: Most, if not all, UI functionality has been implemented in the base class. Typically, subclasses should not need to implement any UI.
SmartCardSession| Constructor Summary | ||
|
protected |
SmartCardReaderSession(SmartCardReader reader)
Construct a new SmartCardReaderSession. |
| Method Summary | ||
|
void |
close()
Closes this session, and unblocks a pending session. |
|
protected abstract void |
closeImpl()
Closes this session. |
|
AnswerToReset |
getAnswerToReset()
Returns the AnswerToReset provided by the physical smartcard present in the reader. |
|
protected abstract AnswerToReset |
getAnswerToResetImpl()
Returns the AnswerToReset provided by the physical smartcard present in the reader. |
|
SmartCard |
getSmartCard()
Returns the SmartCard present in the reader. |
|
SmartCardReader |
getSmartCardReader()
Returns the associated SmartCardReader. |
|
boolean |
isOpen()
Returns true if the session is open, otherwise false. |
|
protected abstract void |
negotiateProtocolImpl(SmartCardCapabilities cardCapabilities)
Attempts to negotate a new protocol with the smartcard if desired. |
|
void |
sendAPDU(CommandAPDU commandAPDU,
ResponseAPDU responseAPDU)
Transmits an APDU to the reader and blocks waiting for a response. |
|
protected abstract void |
sendAPDUImpl(CommandAPDU commandAPDU,
ResponseAPDU responseAPDU)
Transmits an APDU to the reader and blocks waiting for a response. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected SmartCardReaderSession(SmartCardReader reader)
SmartCardReaderSession.
reader - The associated SmartCardReader.| Method Detail |
public final void close()
protected abstract void closeImpl()
public final AnswerToReset getAnswerToReset() throws SmartCardException
AnswerToReset provided by the physical smartcard present in the reader.
The user may be prompted to insert their smartcard.
AnswerToReset provided by smart card in the reader.SmartCardException - Thrown if an error occurs while reading the smart card.SmartCardSessionClosedException - Thrown if this reader session is closed.SmartCardNoCardPresentException - Thrown if no card is currently present in the reader.protected abstract AnswerToReset getAnswerToResetImpl() throws SmartCardException
AnswerToReset provided by the physical smartcard present in the reader.
Implementations should not bring up UI.AnswerToReset provided by the smart card in the reader.SmartCardException - Thrown if an error occurs while reading the smart card.SmartCardNoCardPresentException - Thrown if no card is currently present in the reader.public final SmartCard getSmartCard() throws SmartCardException
SmartCard present in the reader.
The user may be prompted to insert their smartcard.
SmartCard that is currently present in the reader.SmartCardException - Thrown if an error occurs while reading the smart card.SmartCardSessionClosedException - Thrown if this reader session is closed.public final SmartCardReader getSmartCardReader()
SmartCardReader.
SmartCardReader.public final boolean isOpen()
protected abstract void negotiateProtocolImpl(SmartCardCapabilities cardCapabilities) throws SmartCardException
cardCapabilities - The SmartCardCapabilities the capabilities of the card.SmartCardException - Thrown if an error occurs with the smart card.public final void sendAPDU(CommandAPDU commandAPDU, ResponseAPDU responseAPDU) throws SmartCardException
commandAPDU - The CommandAPDU to send.responseAPDU - The ResponseAPDU received back from the reader.SmartCardException - Thrown if an error occurs while reading the smart card.SmartCardSessionClosedException - Thrown if the reader session is already closed.protected abstract void sendAPDUImpl(CommandAPDU commandAPDU, ResponseAPDU responseAPDU) throws SmartCardException
commandAPDU - The commandAPDU to send.responseAPDU - The responseAPDU to send.SmartCardException - Thrown if an error occurs while reading the
smart card.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2008 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.