org.nst.pasientlink.authenticator
Class Authenticator

java.lang.Object
  |
  +--org.nst.pasientlink.authenticator.Authenticator

public class Authenticator
extends java.lang.Object


Field Summary
static int AUTHENTICATE_SESSION_OK
           
static int AUTHENTICATE_TIMED_OUT
           
static int AUTHENTICATE_UNKNOWN_ERROR
           
static int AUTHENTICATE_WRONG_SINGLEUSEPASSWORD
           
protected static java.lang.String CRYPTOGRAPHY_PROVIDER
           
private  org.apache.log4j.Logger logger
           
private static AuthenticatorStorage myStore
           
private static Utility myUtility
           
protected static java.lang.String PASSWORD_HASH_ALGORITHM
           
private static java.util.Hashtable requests
           
protected static java.lang.String SECURE_RANDOM_ALGORITHM
           
private static int timeoutMinutes
           
 
Constructor Summary
Authenticator()
          Constructor.
 
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
 

Field Detail

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
Constructor Detail

Authenticator

public Authenticator()
Constructor. Initializes and configures system.
Method Detail

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 authenticated
myPasswordHash - 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 authenticate
mySingleUsePasswordHash - 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 identifier
myOldPasswordHash - byte[] containing the old password, hashed
myNewPasswordHash - 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.