|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.smartcard.SmartCardFactory
public final class SmartCardFactory
Provides factory functions for dealing with SmartCard
objects.
SmartCardReaderFactory
Method Summary | ||
---|---|---|
|
static boolean |
addSmartCard(SmartCard newCard)
Register a smart card driver with the smart card and user authenticator frameworks. |
|
static boolean |
addSmartCard(SmartCard newCard,
boolean addSmartCardUserAuthenticator)
Register a smart card driver with the smart card framework. |
|
static SmartCard |
chooseSmartCard()
Prompt the user to select an attached smart card reader. |
|
static int |
getNumSmartCards()
Retrieve the number of registered smart card drivers. |
|
static SmartCard |
getSmartCard(AnswerToReset atr)
Retrieve registered smart card driver that supports provided answer-to-reset code. |
|
static SmartCardSession |
getSmartCardSession(AnswerToReset atr)
Request an open session with a smart card possessing provided answer-to-reset code. |
|
static SmartCardSession |
getSmartCardSession(SmartCard card)
Request an open session with a smart card. |
|
static SmartCardSession |
getSmartCardSession(SmartCardID smartCardID)
Request an open session with a smart card, identified by provided smart card ID. |
|
static SmartCard[] |
getSmartCards()
Retrieve the list of registered smart card drivers. |
|
static SmartCard[] |
getSmartCards(AnswerToReset atr)
Retrieve registered smart card drivers that support the provided answer-to-reset code. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean addSmartCard(SmartCard newCard)
Before you can use a smart card driver within the smart card framework, you must register it. This method also registers the smart card driver with the user authentication framework.
Note: This method is a wrapper for
addSmartCard(newCard, true)
.
newCard
- Smart card driver to register.
ControlledAccessException
- If the provided card is registered with
the smart card framework but could not be registered with the user
authentication framework (because of restricted permissions).
IllegalArgumentException
- If the newCard
parameter is
null
or represents a non-persistable smart card.public static boolean addSmartCard(SmartCard newCard, boolean addSmartCardUserAuthenticator)
Before you can use a smart card driver within the smart card framework, you must register it.
If the invoker provides true for this method's second parameter, this method will register the smart card driver as a user authenticator with the user authenticator framework. Driver implementors may choose to provide false for this method, if they wish to provide a separate user authenticator for additional user-authentication functionality.
newCard
- Smart card driver to register.addSmartCardUserAuthenticator
- True if this method should register
the smart card driver with the user authenticator framework; otherwise, false.
ControlledAccessException
- If the provided card is registered with
the smart card framework but could not be registered with the user
authentication framework (because of restricted permissions).
IllegalArgumentException
- If the newCard
parameter is
null
or represents a non-persistable smart card.net.rim.device.api.userauthenticator
public static SmartCard chooseSmartCard() throws SmartCardException
If the device is not attached to a reader, this method first prompts the user to attach a reader. If the device is attached to more than one reader, this method prompts the user to choose one of the readers.
Note: this method blocks while the selected reader has a currently open session.
SmartCardException
- If an error occurs while reading the smart card.
SmartCardCancelException
- If the user cancels when asked to insert their smart card.
SmartCardNoReaderPresentException
- If no readers are registered.public static SmartCardSession getSmartCardSession(SmartCard card) throws SmartCardException
This method may prompt the user to attach the reader or insert the smart card, in order to retrieve an open session.
card
- Card driver to use for opening session to card.
SmartCardException
- If an error occurs while reading from the smart card.
SmartCardCancelException
- If the user cancels when asked to insert
their smart card or reader.
SmartCardNoReaderPresentException
- If there are no readers
registered in which to establish a connection.public static SmartCardSession getSmartCardSession(AnswerToReset atr) throws SmartCardException
This method may prompt the user to attach the reader or insert the smart card, in order to retrieve an open session.
atr
- Answer-to-reset code used to identify the smart card for the session.
SmartCardException
- If an error occurs while reading the smart card.
SmartCardCancelException
- If the user cancels when asked to insert
their smart card or reader.
SmartCardNoCardPresentException
- If no registered smart card
supports the answer-to-reset code.
SmartCardNoReaderPresentException
- If there are no registered
smart card readers present.public static SmartCardSession getSmartCardSession(SmartCardID smartCardID) throws SmartCardException
This method may prompt the user to attach the reader or insert the specific smart card identified by the smart card ID.
smartCardID
- ID that identifies the smart card for the session.
SmartCardException
- If an error occurs while reading the smart card.
SmartCardCancelException
- If the user cancels when asked to insert
their smart card or reader.
SmartCardNoReaderPresentException
- If there are no registered
smart card readers present.public static SmartCard getSmartCard(AnswerToReset atr)
This method searches the list of registered smart cards drivers, and returns the first implementation that indicates it can communicate with a physical smart card possessing the given answer-to-reset code.
atr
- Answer-to-reset code to identify the smart card for the open session.
public static SmartCard[] getSmartCards(AnswerToReset atr)
This method searches the list of registered smart cards drivers, and returns all of the smart cards that indicate that they can communicate with a physical smart card possessing the given answer-to-reset code.
atr
- Answer-to-reset code to identify the smart card for the open session.
public static SmartCard[] getSmartCards()
public static int getNumSmartCards()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 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. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.