info.joseluismartin.auth
Class AuthHashMD5

java.lang.Object
  extended by 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)

Constructor Summary
AuthHashMD5()
           
 
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
 

Constructor Detail

AuthHashMD5

public AuthHashMD5()
Method Detail

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 user
userPassword - 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.