|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.nst.pasientlink.authenticator.Utility
Field Summary | |
protected static java.lang.String |
AUTHENTICATOR_CONFIGURATION_PROPERTIES
|
private static java.util.Properties |
configuration
|
private java.security.MessageDigest |
digest
|
private static org.apache.log4j.Logger |
logger
|
private AuthenticatorStorage |
myStore
|
private java.security.SecureRandom |
randomizer
|
protected static int |
SINGLEUSEPASSWORD_LENGTH
|
private static java.lang.Object |
SMSsemaphore
|
Constructor Summary | |
Utility()
constructor. |
Method Summary | |
boolean |
byteArrayCompare(byte[] a,
byte[] b)
byteArrayCompare compares two byte arrays. |
private void |
configureLogger()
configureLogger configures the logger |
protected boolean |
createUser(java.lang.String myUserID,
java.lang.String myUserDescription,
java.lang.String myPassword,
java.lang.String myGSMSubscriberID)
createUser creates a user from the specified input parameters, given that a user with the same userid does not exist. |
java.lang.String |
generateSingleUsePassword()
generateSingleUsePassword generates and returns a five digit single-use password encoded as a string, using the secure random generator. this value is used in to be used in the second phase of the authentication process |
static java.util.Properties |
getConfiguration()
getConfiguration is called by misc. classes to get the configuration properties for the authenticator |
static org.apache.log4j.Logger |
getLogger()
getLogger returns the logger instance to be used throughout the application |
byte[] |
hashString(java.lang.String myString)
hashString returns a hash of the input String |
protected void |
loadConfiguration()
loadConfiguration loads configuration properties from file using the getResourceAsStream method. |
static void |
main(java.lang.String[] args)
Main. |
boolean |
sendSMSNotification(Request myRequest,
java.lang.String adminGSMSubscriberID)
sendSMSNotification spawns a thread to send a GSM SMS single use password notification. |
void |
setAuthenticatorStorage(AuthenticatorStorage myAuthenticatorStorage)
setAuthenticatorStorage configures the storage class used by utility |
protected boolean |
verifyPasswordHash(java.lang.String myUserID,
byte[] myPasswordHash)
verify that the specified password hash compares successfully with the stored password hash, for the specified user. we assume that the user id exists in the system, i.e. that this has been verified before this method is invoked (but we won't crash horribly if this verification has not been done). |
Methods inherited from class java.lang.Object |
|
Field Detail |
private AuthenticatorStorage myStore
private java.security.SecureRandom randomizer
protected static final int SINGLEUSEPASSWORD_LENGTH
protected static final java.lang.String AUTHENTICATOR_CONFIGURATION_PROPERTIES
private java.security.MessageDigest digest
private static org.apache.log4j.Logger logger
private static java.lang.Object SMSsemaphore
private static java.util.Properties configuration
Constructor Detail |
public Utility()
myAuthenticator
- Authenticator instanceMethod Detail |
public static void main(java.lang.String[] args)
args
- String[] contains command line parametersprotected boolean verifyPasswordHash(java.lang.String myUserID, byte[] myPasswordHash)
myUserID
- String containing the user id of the user password to be verifiedmyPasswordHash
- byte[] containing the password hash of the user to be verifiedpublic java.lang.String generateSingleUsePassword()
Authenticator
public boolean sendSMSNotification(Request myRequest, java.lang.String adminGSMSubscriberID)
myRequest
- Request containing single use password, userid etc. to be sentadminGSMSubscriberID
- String containing admin GSM subscriber ID, or null if this is not an admin requestprotected boolean createUser(java.lang.String myUserID, java.lang.String myUserDescription, java.lang.String myPassword, java.lang.String myGSMSubscriberID)
myUserID
- String containing userID of the new usermyUserDescription
- String containing a description, typically name, of the new usermyPassword
- String containing password for the new usermyGSMSubscriberID
- String containing the GSM phone number of the new userpublic byte[] hashString(java.lang.String myString)
myString
- String to be hashedpublic boolean byteArrayCompare(byte[] a, byte[] b)
a
- byte[] first byte arrayb
- byte[] second byte arrayprivate void configureLogger()
public static org.apache.log4j.Logger getLogger()
public static java.util.Properties getConfiguration()
protected void loadConfiguration()
public void setAuthenticatorStorage(AuthenticatorStorage myAuthenticatorStorage)
myAuthenticatorStorage
- AuthenticatorStorage object to be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |