|
JAAS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.security.auth.module.KeyStoreLoginModule
Provides a JAAS login module that prompts for a key store alias and
populates the subject with the alias's principal and credentials. Stores
an X500Principal for the subject distinguished name of the
first certificate in the alias's credentials in the subject's principals,
the alias's certificate path in the subject's public credentials, and a
X500PrivateCredential whose certificate is the first
certificate in the alias's certificate path and whose private key is the
alias's private key in the subject's private credentials.
Recognizes the following options in the JAAS authentication policy file:
keyStoreURL java.home system property. keyStoreType KeyStore.getDefaultType(). keyStoreProvider keyStoreAlias keyStorePasswordURL privateKeyPasswordURL
| Constructor Summary | |
KeyStoreLoginModule()
|
|
| Method Summary | |
boolean |
abort()
This method is called if the LoginContext's overall authentication failed. |
boolean |
commit()
Abstract method to commit the authentication process (phase 2). |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map sharedState,
Map options)
Initialize this LoginModule. |
boolean |
login()
Authenticate the user . |
boolean |
logout()
Logout a user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public KeyStoreLoginModule()
| Method Detail |
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map sharedState,
Map options)
LoginModule.
initialize in interface LoginModulesubject - the Subject to be authenticated. callbackHandler - a CallbackHandler for communicating
with the end user (prompting for usernames and
passwords, for example). sharedState - shared LoginModule state. options - options specified in the login
Configuration for this particular
LoginModule.
public boolean login()
throws LoginException
Prompt the user for the Keystore alias and the password. Retrieve the alias's principal and credentials from the Keystore.
login in interface LoginModuleLoginModule
should not be ignored).
FailedLoginException - if the authentication fails.
LoginException
public boolean commit()
throws LoginException
This method is called if the LoginContext's overall authentication succeeded (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules succeeded).
If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
login method), then this method associates a
X500Principal for the subject distinguished name of the
first certificate in the alias's credentials in the subject's
principals,the alias's certificate path in the subject's public
credentials, and aX500PrivateCredential whose certificate
is the first certificate in the alias's certificate path and whose
private key is the alias's private key in the subject's private
credentials. If this LoginModule's own
authentication attempted failed, then this method removes
any state that was originally saved.
commit in interface LoginModuleLoginException - if the commit fails
public boolean abort()
throws LoginException
This method is called if the LoginContext's overall authentication failed. (the relevant REQUIRED, REQUISITE, SUFFICIENT and OPTIONAL LoginModules did not succeed).
If this LoginModule's own authentication attempt
succeeded (checked by retrieving the private state saved by the
login and commit methods),
then this method cleans up any state that was originally saved.
abort in interface LoginModuleLoginException - if the abort fails.
public boolean logout()
throws LoginException
This method removes the Principals, public credentials and the
private credentials that were added by the commit method.
logout in interface LoginModuleLoginModule
should not be ignored.
LoginException - if the logout fails.
|
JAAS | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||