Package eu.webtoolkit.jwt.auth
Class BCryptHashFunction
java.lang.Object
eu.webtoolkit.jwt.auth.HashFunction
eu.webtoolkit.jwt.auth.BCryptHashFunction
A cryptograhpic hash function implemented using BCrypt.
This hash function can be used for creating password hashes.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
BCryptHashFunction
public BCryptHashFunction()
-
-
Method Details
-
getName
Returns the name for this hash function. Returns "BCrypt".- Specified by:
getName
in classHashFunction
-
compute
Description copied from class:HashFunction
Computes the hash of a message + salt.The message is usually an ASCII or UTF-8 string.
The
salt
and the computed hash are encoded in printable characters. This is usually ASCII-encoded or could be Base64-encoded.- Specified by:
compute
in classHashFunction
-
verify
Description copied from class:HashFunction
Verifies a message with the salted hash.The base implementation will recompute the hash of the message with the given salt, and compare it to the
hash
.Some methods however store the salt and additional settings in the
hash
, and this information is thus needed to verify the message hash.- Overrides:
verify
in classHashFunction
-
main
-