public static final class PasswordHashUpgrader.Default extends Object implements PasswordHashUpgrader
PasswordHashUpgrader.DefaultCOMPOUND_FORMAT_VERSION| Constructor and Description |
|---|
Default(SecureRandom secureRandom) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isCompoundHashMessage(String bkdfPasswordHashFormat2)
Efficently checks a base64 string if it is in compound hash data format.
|
CompoundHashData |
upgradePasswordHashTo(int costFactor,
String bkdfPasswordHashFormat2)
Upgrades the given hash to the given new cost factor.
|
CompoundHashData |
upgradePasswordHashWith(Version version,
int costFactor,
String bkdfPasswordHashFormat2)
Upgrades the given hash with the given new hash config (ie.
|
boolean |
verifyCompoundHash(char[] password,
String bkdfPasswordHashFormat2)
Verify a hash in compound format.
|
public Default(SecureRandom secureRandom)
public CompoundHashData upgradePasswordHashWith(Version version, int costFactor, String bkdfPasswordHashFormat2)
PasswordHashUpgrader
This will chain the current hash with given hash exactly as defined by the the input paramters. E.g.
if the current hash is [(VERSION_1, 4)] and the the following will be passed: (VERSION_2, 10), the resulting
hash config is [(VERSION_1, 4), (VERSION_2, 10)].
upgradePasswordHashWith in interface PasswordHashUpgraderversion - of the BKDF password hash to be usedcostFactor - to be used on the current hashbkdfPasswordHashFormat2 - the current hash. Can be in compound or normal password hash formatpublic CompoundHashData upgradePasswordHashTo(int costFactor, String bkdfPasswordHashFormat2)
PasswordHashUpgrader
This will chain the current hash with possibly multiple hash configs to achieve the new final cost factor. E.g. if current cost-factor
is 5 and new cost-factor should be 7, the following sequence of hashes will be applied: 5 + [5, 6]. Note that cost-factor
is seen as 2^cost-factor therefore 5 equals 32 iterations and 7, 128 iterations.
upgradePasswordHashTo in interface PasswordHashUpgradercostFactor - to be the new final cost factorbkdfPasswordHashFormat2 - the current hash. Can be in compound or normal password hash formatpublic boolean verifyCompoundHash(char[] password,
String bkdfPasswordHashFormat2)
PasswordHashUpgrader
See also CompoundHashData and PasswordHashVerifier.verify(char[], HashData).
verifyCompoundHash in interface PasswordHashUpgraderpassword - to verify againstbkdfPasswordHashFormat2 - containing the hash datapublic boolean isCompoundHashMessage(String bkdfPasswordHashFormat2)
PasswordHashUpgrader
See PasswordHashUpgrader.COMPOUND_FORMAT_VERSION and CompoundHashData
isCompoundHashMessage in interface PasswordHashUpgraderbkdfPasswordHashFormat2 - to possible be in compound hash formatCopyright © 2018. All rights reserved.