Class AuthFileBCryptHash
java.lang.Object
edu.ucsb.nceas.metacat.authentication.AuthFileBCryptHash
- All Implemented Interfaces:
AuthFileHashInterface
A class to use the BCryptHash algorithm to generate the hash. This is a recommended way
to protect password.
- Author:
- tao
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
AuthFileBCryptHash
public AuthFileBCryptHash()Default Constructor
-
-
Method Details
-
match
Description copied from interface:AuthFileHashInterface
Check if the plain password matches the hashed password. Return true if they match; false otherwise.- Specified by:
match
in interfaceAuthFileHashInterface
- Parameters:
plain
- the plain passwordhashed
- the hashed password- Returns:
- true if they match
- Throws:
Exception
-
hash
Description copied from interface:AuthFileHashInterface
Generate the hash value for a specified plaint password- Specified by:
hash
in interfaceAuthFileHashInterface
- Parameters:
plain
- the plain password- Returns:
- the hash value of the password
-