org.opensc.pkcs11
Class PKCS11EventCallback

java.lang.Object
  extended by org.opensc.pkcs11.PKCS11EventCallback
All Implemented Interfaces:
Callback

public class PKCS11EventCallback
extends Object
implements Callback

This callback is passed to a CallbackHandlerProtection, which is passed as part of a PKCS11LoadStoreParameter instance to KeyStore#load(java.security.KeyStore.LoadStoreParameter). An event callback is invoked each time a defined event occurrs during the authentication process against a token.

Author:
wglas
See Also:
KeyStore.CallbackHandlerProtection, CallbackHandler, KeyStore.LoadStoreParameter, PKCS11LoadStoreParameter.getEventHandler(), PKCS11LoadStoreParameter.setEventHandler(CallbackHandler), KeyStore.load(java.security.KeyStore.LoadStoreParameter)

Field Summary
static int AUHENTICATION_ABORTED
          The authentication has been aborted by the user.
static int AUHENTICATION_FAILED
          The presented PIN was wrong or the authentication failed due to a hardware error.
static int AUHENTICATION_SUCEEDED
          The PIN has been successfully presented to the token and has been verified.
static int CARD_WAIT_FAILED
          The provider detected a failure while waiting for the insertion of a card into a token's slot.
static int HW_AUTHENTICATION_IN_PROGRESS
          The provider is waiting for the entry of a PIN on the token.
static int INITIALIZATION_FAILED
          The initialization of the token failed.
static int NO_EVENT
          A dummy event for initializing an empty event callback.
static int PIN_AUTHENTICATION_IN_PROGRESS
          The PIN entry suceeded and the authentication process against the token starts.
static int PIN_ENTRY_ABORTED
          The PIN entry has been aborted by the user.
static int PIN_ENTRY_FAILED
          The PIN entry failed either through a timeout or a hardware failure.
static int SO_AUHENTICATION_ABORTED
          The SO authentication has been aborted by the user.
static int SO_AUHENTICATION_FAILED
          The presented SO PIN was wrong or the authentication failed due to a hardware error.
static int SO_AUHENTICATION_SUCEEDED
          The SO PIN has been successfully presented to the token and has been verified.
static int SO_HW_AUTHENTICATION_IN_PROGRESS
          The provider is waiting for the entry of a SO PIN on the token.
static int SO_PIN_AUTHENTICATION_IN_PROGRESS
          The SO PIN entry suceeded and the authentication process against the token starts.
static int SO_PIN_ENTRY_ABORTED
          The SO PIN entry has been aborted by the user.
static int SO_PIN_ENTRY_FAILED
          The SO PIN entry failed either through a timeout or a hardware failure.
static int WAITING_FOR_CARD
          The provider is waiting for the insertion of a card into a token's slot.
static int WAITING_FOR_SW_PIN
          The provider is waiting for the entry of a PIN using a PasswordCallback.
static int WAITING_FOR_SW_SO_PIN
          The provider is waiting for the entry of a SO PIN using a PasswordCallback.
 
Constructor Summary
PKCS11EventCallback(int event)
          Constructs an event callback signifying the given event.
 
Method Summary
 int getEvent()
           
 void setEvent(int event)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_EVENT

public static final int NO_EVENT
A dummy event for initializing an empty event callback.

See Also:
Constant Field Values

INITIALIZATION_FAILED

public static final int INITIALIZATION_FAILED
The initialization of the token failed.

See Also:
Constant Field Values

WAITING_FOR_CARD

public static final int WAITING_FOR_CARD
The provider is waiting for the insertion of a card into a token's slot.

See Also:
Constant Field Values

CARD_WAIT_FAILED

public static final int CARD_WAIT_FAILED
The provider detected a failure while waiting for the insertion of a card into a token's slot.

See Also:
Constant Field Values

WAITING_FOR_SW_PIN

public static final int WAITING_FOR_SW_PIN
The provider is waiting for the entry of a PIN using a PasswordCallback.

See Also:
PKCS11Slot.hasTokenProtectedAuthPath(), PasswordCallback, Constant Field Values

PIN_ENTRY_FAILED

public static final int PIN_ENTRY_FAILED
The PIN entry failed either through a timeout or a hardware failure.

See Also:
Constant Field Values

PIN_ENTRY_ABORTED

public static final int PIN_ENTRY_ABORTED
The PIN entry has been aborted by the user.

See Also:
Constant Field Values

HW_AUTHENTICATION_IN_PROGRESS

public static final int HW_AUTHENTICATION_IN_PROGRESS
The provider is waiting for the entry of a PIN on the token. This event is invoked for tokens with a PINpad or another protected authentication path. Tokens without a protected authentication path receive a PasswordCallback instead.

See Also:
PKCS11Slot.hasTokenProtectedAuthPath(), PasswordCallback, Constant Field Values

PIN_AUTHENTICATION_IN_PROGRESS

public static final int PIN_AUTHENTICATION_IN_PROGRESS
The PIN entry suceeded and the authentication process against the token starts.

See Also:
Constant Field Values

AUHENTICATION_FAILED

public static final int AUHENTICATION_FAILED
The presented PIN was wrong or the authentication failed due to a hardware error.

See Also:
Constant Field Values

AUHENTICATION_ABORTED

public static final int AUHENTICATION_ABORTED
The authentication has been aborted by the user.

See Also:
Constant Field Values

AUHENTICATION_SUCEEDED

public static final int AUHENTICATION_SUCEEDED
The PIN has been successfully presented to the token and has been verified.

See Also:
Constant Field Values

WAITING_FOR_SW_SO_PIN

public static final int WAITING_FOR_SW_SO_PIN
The provider is waiting for the entry of a SO PIN using a PasswordCallback.

See Also:
PKCS11Slot.hasTokenProtectedAuthPath(), PasswordCallback, Constant Field Values

SO_PIN_ENTRY_FAILED

public static final int SO_PIN_ENTRY_FAILED
The SO PIN entry failed either through a timeout or a hardware failure.

See Also:
Constant Field Values

SO_PIN_ENTRY_ABORTED

public static final int SO_PIN_ENTRY_ABORTED
The SO PIN entry has been aborted by the user.

See Also:
Constant Field Values

SO_PIN_AUTHENTICATION_IN_PROGRESS

public static final int SO_PIN_AUTHENTICATION_IN_PROGRESS
The SO PIN entry suceeded and the authentication process against the token starts.

See Also:
Constant Field Values

SO_HW_AUTHENTICATION_IN_PROGRESS

public static final int SO_HW_AUTHENTICATION_IN_PROGRESS
The provider is waiting for the entry of a SO PIN on the token. This event is invoked for tokens with a PINpad or another protected authentication path. Tokens without a protected authentication path receive a PasswordCallback instead.

See Also:
PKCS11Slot.hasTokenProtectedAuthPath(), PasswordCallback, Constant Field Values

SO_AUHENTICATION_FAILED

public static final int SO_AUHENTICATION_FAILED
The presented SO PIN was wrong or the authentication failed due to a hardware error.

See Also:
Constant Field Values

SO_AUHENTICATION_ABORTED

public static final int SO_AUHENTICATION_ABORTED
The SO authentication has been aborted by the user.

See Also:
Constant Field Values

SO_AUHENTICATION_SUCEEDED

public static final int SO_AUHENTICATION_SUCEEDED
The SO PIN has been successfully presented to the token and has been verified.

See Also:
Constant Field Values
Constructor Detail

PKCS11EventCallback

public PKCS11EventCallback(int event)
Constructs an event callback signifying the given event.

Method Detail

getEvent

public int getEvent()
Returns:
Returns the event, which occurred during the authentication.

setEvent

public void setEvent(int event)
Parameters:
event - The event to set.

toString

public String toString()
Overrides:
toString in class Object