de.innovationgate.utils.security
public class BCrypt10HashingScheme extends java.lang.Object implements HashingService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
BCrypt10HashingScheme() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkPassword(byte[] secret,
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
HashingService.createHash(byte[], Object) method. |
java.lang.String |
getName()
Returns the name of this hashing scheme
|
public static final java.lang.String NAME
public java.lang.String createHash(byte[] secret, java.lang.Object salt) throws HashingException
HashingService
createHash
in interface HashingService
secret
- The datasalt
- A salt to use for hashingHashingException
public boolean checkPassword(byte[] secret, java.lang.String hash) throws HashingException
HashingService
checkPassword
in interface HashingService
secret
- The datahash
- The hashHashingException
public java.lang.Object generateSalt() throws HashingException
HashingService
HashingService.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 equalitygenerateSalt
in interface HashingService
HashingException
public java.lang.String getName()
HashingService
getName
in interface HashingService