public class CompactPasswordHash
extends java.lang.Object
CompactPasswordKey
AND CompactPasswordHash
.
You would store the hash and hence the encryption key in plain text!
CompactPasswordKey.isPasswordValid()
)
to immediately check if a user provided the correct/valid password.
Modifier and Type | Class and Description |
---|---|
static class |
CompactPasswordHash.GenerationParametersCPH
None of these parameters have to be set, defaults will be used instead for each single parameter being not set.
|
Modifier and Type | Method and Description |
---|---|
static CompactPasswordHash.GenerationParametersCPH |
createParameters()
Create an empty parameters object to set single parameters that shall be changed from defaults
|
static CompactPasswordHash.GenerationParametersCPH |
createParameters(java.lang.String hmacAlgorithm,
int hashLengthInBytes,
int saltLengthInBytes,
int iterationCount)
None of these parameters have to be set, defaults will be used instead for each single parameter being not set.
|
static CompactPasswordHash |
generateHash(Secret passwordOrSecret) |
static CompactPasswordHash |
generateHash(Secret passwordOrSecret,
CompactPasswordHash.GenerationParametersCPH parameters) |
byte[] |
getHashInBytes() |
java.lang.String |
getHMACAlgorithm() |
int |
getIterationCount() |
byte[] |
getSaltInBytes() |
static CompactPasswordHash |
newInstance()
Creates an uninitialized hash object.
|
void |
readFromBase64(java.lang.String base64) |
void |
readFromBytes(byte[] bytes) |
void |
readFromHex(java.lang.String hex) |
boolean |
verifyPassword(Secret password) |
java.lang.String |
writeToBase64() |
byte[] |
writeToBytes() |
java.lang.String |
writeToHex() |
public byte[] getHashInBytes()
public byte[] getSaltInBytes()
public int getIterationCount()
public java.lang.String getHMACAlgorithm()
public byte[] writeToBytes()
public java.lang.String writeToBase64()
public java.lang.String writeToHex()
public void readFromBytes(byte[] bytes)
public void readFromBase64(java.lang.String base64)
public void readFromHex(java.lang.String hex)
public boolean verifyPassword(Secret password)
public static final CompactPasswordHash generateHash(Secret passwordOrSecret)
public static final CompactPasswordHash generateHash(Secret passwordOrSecret, CompactPasswordHash.GenerationParametersCPH parameters)
public static final CompactPasswordHash newInstance()
public static final CompactPasswordHash.GenerationParametersCPH createParameters()
public static final CompactPasswordHash.GenerationParametersCPH createParameters(java.lang.String hmacAlgorithm, int hashLengthInBytes, int saltLengthInBytes, int iterationCount)