public final class

SunPKCS11

extends AuthProvider
java.lang.Object
   ↳ java.util.Dictionary<K, V>
     ↳ java.util.Hashtable<K, V>
       ↳ java.util.Properties
         ↳ java.security.Provider
           ↳ java.security.AuthProvider
             ↳ sun.security.pkcs11.SunPKCS11

Class Overview

PKCS#11 provider main class.

Summary

[Expand]
Inherited Fields
From class java.util.Properties
Public Constructors
SunPKCS11()
SunPKCS11(String configName)
SunPKCS11(InputStream configStream)
SunPKCS11(String configName, InputStream configStream)
This constructor is deprecated. use new SunPKCS11(String) or new SunPKCS11(InputStream) instead
Public Methods
boolean equals(Object obj)
Compares the specified Object with this Map for equality, as per the definition in the Map interface.
int hashCode()
Returns the hash code value for this Map as per the definition in the Map interface.
void login(Subject subject, CallbackHandler handler)
Log in to this provider.
void logout()
Log out from this provider
void setCallbackHandler(CallbackHandler handler)
Set a CallbackHandler

The provider uses this handler if one is not passed to the login method.

[Expand]
Inherited Methods
From class java.security.AuthProvider
From class java.security.Provider
From class java.util.Properties
From class java.util.Hashtable
From class java.util.Dictionary
From class java.lang.Object
From interface java.util.Map

Public Constructors

public SunPKCS11 ()

public SunPKCS11 (String configName)

public SunPKCS11 (InputStream configStream)

public SunPKCS11 (String configName, InputStream configStream)

This constructor is deprecated.
use new SunPKCS11(String) or new SunPKCS11(InputStream) instead

Public Methods

public boolean equals (Object obj)

Compares the specified Object with this Map for equality, as per the definition in the Map interface.

Parameters
obj object to be compared for equality with this hashtable
Returns
  • true if the specified Object is equal to this Map

public int hashCode ()

Returns the hash code value for this Map as per the definition in the Map interface.

Returns
  • a hash code value for this object.

public void login (Subject subject, CallbackHandler handler)

Log in to this provider.

If the token expects a PIN to be supplied by the caller, the handler implementation must support a PasswordCallback.

To determine if the token supports a protected authentication path, the CK_TOKEN_INFO flag, CKF_PROTECTED_AUTHENTICATION_PATH, is consulted.

Parameters
subject this parameter is ignored
handler the CallbackHandler used by this provider to communicate with the caller
Throws
LoginException if the login operation fails
SecurityException if the does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method

public void logout ()

Log out from this provider

Throws
LoginException if the logout operation fails
SecurityException if the does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method

public void setCallbackHandler (CallbackHandler handler)

Set a CallbackHandler

The provider uses this handler if one is not passed to the login method. The provider also uses this handler if it invokes login on behalf of callers. In either case if a handler is not set via this method, the provider queries the auth.login.defaultCallbackHandler security property for the fully qualified class name of a default handler implementation. If the security property is not set, the provider is assumed to have alternative means for obtaining authentication information.

Parameters
handler a CallbackHandler for obtaining authentication information, which may be null
Throws
SecurityException if the caller does not pass a security check for SecurityPermission("authProvider.name"), where name is the value returned by this provider's getName method