|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hardtokenmgmt.core.token.TokenManager
public class TokenManager
This is the main class for token management. It manages available slots (card readers) and returns the right IToken interface for inserted cards depending on card type.
| Field Summary | |
|---|---|
static int |
SLOTTYPE_ADMIN
Constants indicating that all slots containing certificates belonging to an administrator. |
static int |
SLOTTYPE_ALL
Constants indicating that all available slots (With or without any cards inserted) should be returned. |
static int |
SLOTTYPE_PRESENT
Constants indicating that all available slots (With any cards inserted) should be returned. |
static int |
SLOTTYPE_PROCESSABLECARDS
Constants indicating that all slots with a processable card inserted should be returned. |
| Constructor Summary | |
|---|---|
TokenManager()
|
|
| Method Summary | |
|---|---|
void |
flushTokenCache()
Method that should be called every time one of the tokens is removed from it's reader. |
ILogonCertificateSelector |
getLogonCertificateSelector()
Method returning the logon certificate selector defined in the global properties file. |
java.util.Collection |
getSlots(int type)
Method returning a Collection of iaik.pkcs.pkcs11.Slot. |
IToken |
getToken(iaik.pkcs.pkcs11.Slot slot)
Method that returns the the IToken implementation for the token inserted in the selected slot. |
void |
stopAllThreads()
Method that should be called by the main application when terminating, signaling that all the current threads should stop. |
void |
stopNonAdminCardWaitingThreads()
Methods that waits for all card waiting threads to stop before proceeding. |
void |
switchToAdminCardRemovalRunnable(java.util.Observer observer)
Method used in the logon controller to switch waiting for any card to be removed to just wait for the administration card to be removed. |
void |
waitForAdminCardRemoval(java.util.Observer observer)
Special Method checking that the admin card is still inserted |
void |
waitForCardInsertion(java.util.Observer observer)
Method waiting for a card to be inserted in a slot not containing the administrator related certificates. |
void |
waitForCardRemoval(java.util.Observer observer)
Method waiting for the card to be removed from selected slot. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SLOTTYPE_ALL
public static final int SLOTTYPE_PRESENT
public static final int SLOTTYPE_ADMIN
public static final int SLOTTYPE_PROCESSABLECARDS
| Constructor Detail |
|---|
public TokenManager()
| Method Detail |
|---|
public java.util.Collection getSlots(int type)
throws iaik.pkcs.pkcs11.TokenException
type - one of the SLOTTYPE constants of slots to return
iaik.pkcs.pkcs11.TokenException
OperationNotSupportedExceptionpublic void waitForCardInsertion(java.util.Observer observer)
observer - class the Observer interface that waits for the card insertion.
The observer will get slot as argument Or the exception that occurred during
the process.
OperationNotSupportedExceptionpublic void waitForCardRemoval(java.util.Observer observer)
observer - observer class the Observer interface
that waits for the card removal for the given slot.
The observer will get a null value if the operation was
successful or the exception if something went wrong.
OperationNotSupportedExceptionpublic void waitForAdminCardRemoval(java.util.Observer observer)
observer - observer class the Observer interface
that waits for the card removal for the given slot.
The observer will get a null value if the operation was
successful or the exception if something went wrong.
OperationNotSupportedExceptionpublic void switchToAdminCardRemovalRunnable(java.util.Observer observer)
public void stopNonAdminCardWaitingThreads()
public IToken getToken(iaik.pkcs.pkcs11.Slot slot)
slot - with token in it
public void flushTokenCache()
public void stopAllThreads()
public ILogonCertificateSelector getLogonCertificateSelector()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||