public boolean validatePassword(char[] password,String goodHash){
  String[] params=goodHash.split(":");
  int iterations=Integer.parseInt(params[ITERATION_INDEX]);
  byte[] salt=fromHex(params[SALT_INDEX]);
  byte[] hash=fromHex(params[PBKDF2_INDEX]);
  byte[] testHash=pbkdf2(password,salt,iterations,hash.length);
  return slowEquals(hash,testHash);
}

public boolean validatePassword ( char [ ] password , String goodHash ) { String [ ] params = goodHash . split ( ":" ) ; int iterations = Integer . parseInt ( params [ ITERATION_INDEX ] ) ; byte [ ] salt = fromHex ( params [ SALT_INDEX ] ) ; byte [ ] hash = fromHex ( params [ PBKDF2_INDEX ] ) ; byte [ ] testHash = pbkdf2 ( password , salt , iterations , hash . length ) ; return slowEquals ( hash , testHash ) ; }
validates a password using a hash .
