SHOW Signed
 

net.rim.device.api.smartcard
Class SmartCardReaderFactory

java.lang.Object
  |
  +--net.rim.device.api.smartcard.SmartCardReaderFactory

public final class SmartCardReaderFactory
extends Object

Provides factory functions to return SmartCardReader and SmartCardReaderSession objects.

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:
JDE 4.1.0
See Also:
SmartCardReader, SmartCardFactory

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 SmartCardReader[] getReaders()
          Returns all the 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.
 
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.
Since:
JDE 4.1.0
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.

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.
Since:
JDE 4.1.0
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.

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.
Since:
JDE 4.1.0
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.

getNumSmartCardReaders

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

Returns:
The number of registered smart card readers
Since:
JDE 4.1.0
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.

getReaders

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

Returns:
An array of SmartCardReaders.
Since:
JDE 4.1.0
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.

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.
Since:
JDE 4.1.0
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.



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.