|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.smartcard.SmartCard
Represents a kind (or model or family) of a physical smart card, as opposed to one unique smart card.
As such, the SmartCard and SmartCardSession objects embody only the mechanisms or protocols
to communicate with one kind of smart card. Therefore, there is only one SmartCard object instantiated on
the device per kind of smart card.
To communicate with the smart card, the developer must call openSession().
Once a session has been opened, it is assumed that some card unique data (perhaps a serial number,
see SmartCardID, SmartCardID) may be extracted
to identify a particular smart card.
Note to implementators: Most, if not all, UI functionality has been implemented in the base class. Typically, subclasses should not need to implement any UI. Subclasses should implement Persistable, and must not contain any state information ( member variables ).
For information on implementing smart cards, see Adding smart card drivers to the SmartCard API. This tutorial describes the process of adding support for new smart cards and smart card drivers to the API.
Sub-classes must explicitly implement the Persistable interface if they are going to be registered as a smart card driver with the SmartCardFactory.
SmartCardFactory,
SmartCardSession,
SmartCardID,
Persistable| Constructor Summary | ||
|
protected |
SmartCard()
Constructs a new SmartCard. |
| Method Summary | ||
|
boolean |
checkAnswerToReset(AnswerToReset atr)
Returns true if this SmartCard implementation should be used
to communicate with a physical smart card that has the given AnswerToReset. |
|
protected abstract boolean |
checkAnswerToResetImpl(AnswerToReset atr)
Returns true if this SmartCard implementation should be used
to communicate with a physical smart card that has the given AnswerToReset. |
|
void |
displaySettings(Object context)
Allows the driver to display some settings or properties. |
|
protected void |
displaySettingsImpl(Object context)
Allows the driver to display some settings or properties. |
|
boolean |
equals(Object obj)
This method returns true if this smart card object is equal to the obj parameter. |
|
SmartCardCapabilities |
getCapabilities()
Returns the SmartCardCapabilities of the smart card. |
|
protected abstract SmartCardCapabilities |
getCapabilitiesImpl()
Returns the SmartCardCapabilities of the smart card. |
|
String |
getLabel()
Returns a label associated with the kind of smart card. |
|
protected abstract String |
getLabelImpl()
Returns a label associated with the kind of smart card. |
|
int |
hashCode()
Returns a hash code value for the object. |
|
boolean |
isDisplaySettingsAvailable(Object context)
Allows the driver to indicate if they support displaying settings. |
|
protected boolean |
isDisplaySettingsAvailableImpl(Object context)
Allows the driver to indicate if they support displaying settings. |
|
SmartCardSession |
openSession(SmartCardReaderSession readerSession)
Returns a session through which an application may communicate with a physical SmartCard. |
|
protected abstract SmartCardSession |
openSessionImpl(SmartCardReaderSession readerSession)
Returns the appropriate subclass of SmartCardSession. |
|
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected SmartCard()
SmartCard.| Method Detail |
public final boolean checkAnswerToReset(AnswerToReset atr)
SmartCard implementation should be used
to communicate with a physical smart card that has the given AnswerToReset.
This function is called when the system is trying to ascertain which SmartCard implementation should be used to
communicate with a physical SmartCard found in a reader.
atr - The AnswerToReset of the smart card. Must be non-null.protected abstract boolean checkAnswerToResetImpl(AnswerToReset atr)
SmartCard implementation should be used
to communicate with a physical smart card that has the given AnswerToReset.
This function is called when the system is trying to ascertain which SmartCard implementation should be used to
communicate with a physical SmartCard found in a reader.
atr - The AnswerToReset of the smart card. Will be non-null.public final void displaySettings(Object context)
context - Reserved for future use.protected void displaySettingsImpl(Object context)
context - Reserved for future use.public boolean equals(Object obj)
NullPointerException - if obj is null.public final SmartCardCapabilities getCapabilities()
SmartCardCapabilities of the smart card.
protected abstract SmartCardCapabilities getCapabilitiesImpl()
SmartCardCapabilities of the smart card.
public final String getLabel()
The String should not include the words "smart card", as this method will be used to generate strings such as ( "Please insert your %s smart card", getLabel() )
protected abstract String getLabelImpl()
The String should not include the words "smart card", as this method will be used to generate strings such as ( "Please insert your %s smart card", getLabel() )
public int hashCode()
Objectjava.util.Hashtable.
The general contract of hashCode is:
hashCode method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)
ObjectObject.equals(java.lang.Object),
Hashtablepublic final boolean isDisplaySettingsAvailable(Object context)
context - Reserved for future use.protected boolean isDisplaySettingsAvailableImpl(Object context)
context - Reserved for future use.public final SmartCardSession openSession(SmartCardReaderSession readerSession) throws SmartCardException
SmartCardReaderSession may only have one SmartCardSession associated with it.
Note: sessions should be closed promptly when no longer needed.
readerSession - An open communication session with a reader. Must be non null.SmartCardException - Thrown if an error occurs while reading the smart card.SmartCardSessionAlreadyOpenException - Thrown if the reader session already has an open smart card session associated with it.SmartCardSessionClosedException - Thrown if the reader session is closed.protected abstract SmartCardSession openSessionImpl(SmartCardReaderSession readerSession) throws SmartCardException
SmartCardSession.
Implementations of this method should not bring up UI.
readerSession - An open communication session with a reader. Will be non-null.SmartCard.SmartCardException - Thrown if an error occurs while reading the
smart card.public String toString()
ObjecttoString method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 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.