Package org.intermine.util
Class PasswordHasher
- java.lang.Object
-
- org.intermine.util.PasswordHasher
-
public final class PasswordHasher extends java.lang.Object
Utility methods for managing hashed passwords- Author:
- Matthew Wakeling
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
checkPassword(java.lang.String password, java.lang.String hash)
Checks to see if a password matches an optionally hashed password entry.static java.lang.String
hashPassword(java.lang.String password)
Converts a password into a hashed password, with a salt.
-
-
-
Method Detail
-
hashPassword
public static java.lang.String hashPassword(java.lang.String password)
Converts a password into a hashed password, with a salt.- Parameters:
password
- the password to hash- Returns:
- a 88-character String containing the salt and the hash
-
checkPassword
public static boolean checkPassword(java.lang.String password, java.lang.String hash)
Checks to see if a password matches an optionally hashed password entry.- Parameters:
password
- the given passwordhash
- the hashed password entry- Returns:
- true if the password matches
-
-