SHOW Signed

net.rim.device.api.smartcard
Class SmartCard

java.lang.Object
  |
  +--net.rim.device.api.smartcard.SmartCard
All Implemented Interfaces:
net.rim.vm.Persistable, Persistable
Direct Known Subclasses:
CryptoSmartCard

public abstract class SmartCard
extends Object
implements Persistable

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.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 4.1.0
See Also:
SmartCardFactory, SmartCardSession, SmartCardID, Persistable

Constructor Summary
 Category: Signed protected SmartCard()
          Constructs a new SmartCard.
 
Method Summary
 Category: Signed  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.
 Category: Signed 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.
 Category: Signed  void displaySettings(Object context)
          Allows the driver to display some settings or properties.
 Category: Signed protected  void displaySettingsImpl(Object context)
          Allows the driver to display some settings or properties.
 Category: Signed  SmartCardCapabilities getCapabilities()
          Returns the SmartCardCapabilities of the smart card.
 Category: Signed protected abstract  SmartCardCapabilities getCapabilitiesImpl()
          Returns the SmartCardCapabilities of the smart card.
 Category: Signed  String getLabel()
          Returns a label associated with the kind of smart card.
 Category: Signed protected abstract  String getLabelImpl()
          Returns a label associated with the kind of smart card.
 Category: Signed  boolean isDisplaySettingsAvailable(Object context)
          Allows the driver to indicate if they support displaying settings.
 Category: Signed protected  boolean isDisplaySettingsAvailableImpl(Object context)
          Allows the driver to indicate if they support displaying settings.
 Category: Signed  SmartCardSession openSession(SmartCardReaderSession readerSession)
          Returns a session through which an application may communicate with a physical SmartCard.
 Category: Signed protected abstract  SmartCardSession openSessionImpl(SmartCardReaderSession readerSession)
          Returns the appropriate subclass of SmartCardSession.
 Category: Signed  String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SmartCard

protected SmartCard()
Constructs a new SmartCard.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

openSession

public final SmartCardSession openSession(SmartCardReaderSession readerSession)
                                   throws SmartCardException
Returns a session through which an application may communicate with a physical SmartCard. A SmartCardReaderSession may only have one SmartCardSession associated with it.

Note: sessions should be closed promptly when no longer needed.

Parameters:
readerSession - An open communication session with a reader. Must be non null.
Returns:
The newly opened communications session with the SmartCard.
Throws:
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.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

openSessionImpl

protected abstract SmartCardSession openSessionImpl(SmartCardReaderSession readerSession)
                                             throws SmartCardException
Returns the appropriate subclass of SmartCardSession.

Implementations of this method should not bring up UI.

Parameters:
readerSession - An open communication session with a reader. Will be non-null.
Returns:
The newly opened communications session with the SmartCard.
Throws:
SmartCardException - Thrown if an error occurs while reading the smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getCapabilities

public final SmartCardCapabilities getCapabilities()
Returns the SmartCardCapabilities of the smart card.

Returns:
The capabilities of the smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getCapabilitiesImpl

protected abstract SmartCardCapabilities getCapabilitiesImpl()
Returns the SmartCardCapabilities of the smart card.

Returns:
The capabilities of the smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

checkAnswerToReset

public final 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. 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.

Parameters:
atr - The AnswerToReset of the smart card. Must be non-null.
Returns:
A boolean that determines if the smart card implementation should be used to communicate with the physical smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

checkAnswerToResetImpl

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. 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.

Parameters:
atr - The AnswerToReset of the smart card. Will be non-null.
Returns:
A boolean that determines if the smart card implementation should be used to communicate with the physical smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getLabel

public final String getLabel()
Returns a label associated with the kind of smart card.

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() )

Returns:
A String representing the label of the smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getLabelImpl

protected abstract String getLabelImpl()
Returns a label associated with the kind of smart card.

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() )

Returns:
A String representing the label of the smart card.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

displaySettings

public final void displaySettings(Object context)
Allows the driver to display some settings or properties. This method will be invoked from the smart card options screen when the user selects the driver and chooses to view the settings of that driver. This method could be called from the event thread. The driver should not block the event thread for long periods of time.
Parameters:
context - Reserved for future use.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

displaySettingsImpl

protected void displaySettingsImpl(Object context)
Allows the driver to display some settings or properties. This method will be invoked from the smart card options screen when the user selects the driver and chooses to view the settings of that driver. This method could be called from the event thread. The driver should not block the event thread for long periods of time.
Parameters:
context - Reserved for future use.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isDisplaySettingsAvailable

public final boolean isDisplaySettingsAvailable(Object context)
Allows the driver to indicate if they support displaying settings. If this method returns true, then the method displaySettings maybe called to show settings to the user.
Parameters:
context - Reserved for future use.
Returns:
true if the driver supports displaying settings, false otherwise.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isDisplaySettingsAvailableImpl

protected boolean isDisplaySettingsAvailableImpl(Object context)
Allows the driver to indicate if they support displaying settings. If this method returns true, then the method displaySettings maybe called to show settings to the user.
Parameters:
context - Reserved for future use.
Returns:
true if the driver supports displaying settings, false otherwise.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

toString

public String toString()
Description copied from class: Object
Returns a string representation of the object. In general, the toString 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())
 
Overrides:
toString in class Object
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2004 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.