Class Password
java.lang.Object
ecmwf.common.security.Password
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Password
public Password()
-
-
Method Details
-
generateHash
public static String generateHash(String password) throws NoSuchAlgorithmException, InvalidKeySpecException Generate hash.- Parameters:
password
- the password- Returns:
- the string
- Throws:
NoSuchAlgorithmException
- the no such algorithm exceptionInvalidKeySpecException
- the invalid key spec exception
-
check
public static boolean check(String password, String storedHash) throws NoSuchAlgorithmException, InvalidKeySpecException Check.- Parameters:
password
- the passwordstoredHash
- the stored hash- Returns:
- true, if successful
- Throws:
NoSuchAlgorithmException
- the no such algorithm exceptionInvalidKeySpecException
- the invalid key spec exception
-