de.innovationgate.utils.security
public interface HashingService
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(byte[] data,
java.lang.String hash)
Compares data to a previously created hash
|
java.lang.String |
createHash(byte[] secret,
java.lang.Object salt)
Create a hash of the given data
|
java.lang.Object |
generateSalt()
Generates a salt to be used with the
createHash(byte[], Object) method. |
java.lang.String |
getName()
Returns the name of this hashing scheme
|
java.lang.String getName()
java.lang.String createHash(byte[] secret, java.lang.Object salt) throws HashingException
secret
- The datasalt
- A salt to use for hashingjava.lang.Exception
HashingException
boolean checkPassword(byte[] data, java.lang.String hash) throws HashingException
data
- The datahash
- The hashHashingException
java.lang.Object generateSalt() throws HashingException
createHash(byte[], Object)
method.
This is callable independently, so a functionality may use the same salt for multiple password hashings and then may test hash equalityHashingException