info.joseluismartin.auth
Class AuthHashMD5
java.lang.Object
info.joseluismartin.auth.AuthHashMD5
- All Implemented Interfaces:
- AuthStrategy
public class AuthHashMD5
- extends Object
- implements AuthStrategy
An AuthStrategy that use HashMD5
- Author:
- Jose Luis Martin - (jlm@joseluismartin.info)
|
Method Summary |
String |
crypt(String suppliedPassword)
crypt a password |
boolean |
validate(String suppliedPassword,
String userPassword)
Test if userPassword is a md5 hash of suppliedPassword |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthHashMD5
public AuthHashMD5()
validate
public boolean validate(String suppliedPassword,
String userPassword)
- Test if userPassword is a md5 hash of suppliedPassword
- Specified by:
validate in interface AuthStrategy
- Parameters:
suppliedPassword - password form useruserPassword - password from db
- Returns:
- true if passwords match
crypt
public String crypt(String suppliedPassword)
throws NoSuchAlgorithmException
- crypt a password
- Specified by:
crypt in interface AuthStrategy
- Parameters:
suppliedPassword -
- Returns:
- crypted password
- Throws:
NoSuchAlgorithmException
Copyright © 2012 JDAL. All Rights Reserved.