net.rim.device.api.smartcard
Class SmartCardReaderFactory

java.lang.Object
  extended by net.rim.device.api.smartcard.SmartCardReaderFactory

public final class SmartCardReaderFactory
extends Object

Provides factory functions to return SmartCardReader and SmartCardReaderSession objects.

See Also:
SmartCardReader, SmartCardFactory
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

Method Summary
Category: Signed static boolean addReader(SmartCardReader newReader)
          Adds the given reader to the list of registered readers.
Category: Signed static SmartCardReader chooseReader()
          Asks the user to select a smart card reader attached to the device.
Category: Signed static SmartCardReader[] getInstalledReaders()
          Returns an array of all the currently installed readers.
Category: Signed static int getNumSmartCardReaders()
          Returns the number of registered smart card readers.
Category: Signed static SmartCardReaderSession getReaderSession(SmartCard smartCard)
          Searches the registered list of SmartCardReaders and returns a communication session with the first implementation that indicates that it can communicate with the given SmartCard.
Category: Signed static SmartCardReaderSession[] getReaderSessions()
          Searches the registered list of SmartCardReaders and returns communication sessions with all implementations that indicate that it has an inserted smart card.
Category: Signed static SmartCardReader[] getReaders()
          Returns all the registered smart card readers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

addReader

public static boolean addReader(SmartCardReader newReader)
Adds the given reader to the list of registered readers.

A reader implementation must be registered before it can be used within the SmartCard API.

Parameters:
newReader - A smart card reader implementation.
Returns:
true if the reader was added, and false if the reader is already registered.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getReaders

public static SmartCardReader[] getReaders()
Returns all the registered smart card readers.

Returns:
An array of SmartCardReaders.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getNumSmartCardReaders

public static int getNumSmartCardReaders()
Returns the number of registered smart card readers.

Returns:
The number of registered smart card readers
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getInstalledReaders

public static SmartCardReader[] getInstalledReaders()
Returns an array of all the currently installed readers. Returns an array of size 0 if no readers are installed.

Returns:
An array of SmartCardReaders.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

chooseReader

public static SmartCardReader chooseReader()
                                    throws SmartCardException
Asks the user to select a smart card reader attached to the device.

This method returns one particular reader from the set of readers that are registered and attached to the device. If there are no readers attached to the device, the user will be prompted to attach a reader. If there are multiple readers attached to the device, the user will be prompted to select one particular reader from the list of readers.

Returns:
The chosen smart card reader.
Throws:
SmartCardException - Thrown if an error occurs while reading from the smart card.
SmartCardCancelException - Thrown if the user cancels when asked to insert their smart card reader
SmartCardNoReaderPresentException - Thrown if no readers are registered.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0

getReaderSessions

public static SmartCardReaderSession[] getReaderSessions()
                                                  throws SmartCardException
Searches the registered list of SmartCardReaders and returns communication sessions with all implementations that indicate that it has an inserted smart card.

Returns:
An array of communication sessions if successful.
Throws:
SmartCardException - Thrown if an error occurs while reading the smart card.
SmartCardCancelException - Thrown if the user cancels when asked to insert their smart card or reader
SmartCardNoReaderPresentException - Thrown if there are no readers registered in which to establish a connection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 5.0.0

getReaderSession

public static SmartCardReaderSession getReaderSession(SmartCard smartCard)
                                               throws SmartCardException
Searches the registered list of SmartCardReaders and returns a communication session with the first implementation that indicates that it can communicate with the given SmartCard.

Parameters:
smartCard - The smart card used to check against the list with.
Returns:
A communication session if successful.
Throws:
SmartCardException - Thrown if an error occurs while reading the smart card.
SmartCardCancelException - Thrown if the user cancels when asked to insert their smart card or reader
SmartCardNoReaderPresentException - Thrown if there are no readers registered in which to establish a connection.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Since:
BlackBerry API 4.1.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal