org.nst.pasientlink.authenticator
Class Authenticator
java.lang.Object
|
+--org.nst.pasientlink.authenticator.Authenticator
- public class Authenticator
- extends java.lang.Object
Method Summary |
int |
authenticate(java.lang.String myUserID,
byte[] mySingleUsePasswordHash)
authenticate performs actual authentication, after an authentication
request has been generated for a user (see class documentation for
a description of two-phased authentification process). |
boolean |
changePassword(java.lang.String myUserID,
byte[] myOldPasswordHash,
byte[] myNewPasswordHash)
changePassword changes the user specified password. |
static void |
main(java.lang.String[] args)
Main method. |
boolean |
requestAuthentication(java.lang.String myUserID,
byte[] myPasswordHash)
requestAuthentication performs the first phase of authentication (see class
documentation for further details of the two-phase authentification process). |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
AUTHENTICATE_SESSION_OK
public static final int AUTHENTICATE_SESSION_OK
AUTHENTICATE_TIMED_OUT
public static final int AUTHENTICATE_TIMED_OUT
AUTHENTICATE_WRONG_SINGLEUSEPASSWORD
public static final int AUTHENTICATE_WRONG_SINGLEUSEPASSWORD
AUTHENTICATE_UNKNOWN_ERROR
public static final int AUTHENTICATE_UNKNOWN_ERROR
SECURE_RANDOM_ALGORITHM
protected static final java.lang.String SECURE_RANDOM_ALGORITHM
PASSWORD_HASH_ALGORITHM
protected static final java.lang.String PASSWORD_HASH_ALGORITHM
CRYPTOGRAPHY_PROVIDER
protected static final java.lang.String CRYPTOGRAPHY_PROVIDER
timeoutMinutes
private static int timeoutMinutes
requests
private static java.util.Hashtable requests
myStore
private static AuthenticatorStorage myStore
myUtility
private static Utility myUtility
logger
private org.apache.log4j.Logger logger
Authenticator
public Authenticator()
- Constructor. Initializes and configures system.
requestAuthentication
public boolean requestAuthentication(java.lang.String myUserID,
byte[] myPasswordHash)
- requestAuthentication performs the first phase of authentication (see class
documentation for further details of the two-phase authentification process).
- Parameters:
myUserID
- String containing the user id for the user to be authenticatedmyPasswordHash
- byte[] containing the hashed password for the user- Returns:
- boolean indicating whether the first phase of the authentication process
completed successfully (true) or not (false)
authenticate
public int authenticate(java.lang.String myUserID,
byte[] mySingleUsePasswordHash)
- authenticate performs actual authentication, after an authentication
request has been generated for a user (see class documentation for
a description of two-phased authentification process).
- Parameters:
myUserID
- String containing the userid of the user to authenticatemySingleUsePasswordHash
- byte[] containing the single-use password
hash, the hashed value of the single use password collected from the user for this auth. request- Returns:
- int value 0 if the user was authenticated, 1 if the request had timed out, 2 if the single use password was wrong
changePassword
public boolean changePassword(java.lang.String myUserID,
byte[] myOldPasswordHash,
byte[] myNewPasswordHash)
- changePassword changes the user specified password. Both the old and new hashed password
must be supplied. the password is only changed into the new password if the old
password matches the stored password for the user. The application invoking this method
should ensure that the new password was typed in correctly before calling this method.
- Parameters:
myUserID
- String containing user identifiermyOldPasswordHash
- byte[] containing the old password, hashedmyNewPasswordHash
- byte[] containing the new password, hashed- Returns:
- boolean indicating whether the password was changed (true) nor not (false). failure to
march the old password with the the main
reason for a failure (false retval)
main
public static void main(java.lang.String[] args)
- Main method. For creating
- Parameters:
args
- string array containing command line parameters
Copyright © 2002 Norwegian Centre for Telemedicine. All Rights Reserved.