|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.rtner.security.auth.spi.PBKDF2Engine
de.rtner.security.auth.spi.SimplePBKDF2
public class SimplePBKDF2
PBKDF2 convenience object that comes pre-configured.
| Field Summary | |
|---|---|
protected PBKDF2Formatter |
formatter
|
protected int |
saltSize
|
protected java.security.SecureRandom |
sr
|
| Fields inherited from class de.rtner.security.auth.spi.PBKDF2Engine |
|---|
parameters, prf |
| Constructor Summary | |
|---|---|
|
SimplePBKDF2()
Constructor for PBKDF2 implementation object that uses defaults. |
|
SimplePBKDF2(int saltSize,
int iterationCount)
Constructor for PBKDF2 implementation object. |
protected |
SimplePBKDF2(int saltSize,
PBKDF2Parameters parameters)
Extension point. |
| Method Summary | |
|---|---|
java.lang.String |
deriveKeyFormatted(java.lang.String inputPassword)
Derive key from password, then format. |
protected byte[] |
generateSalt()
Generate Salt. |
PBKDF2Formatter |
getFormatter()
|
int |
getSaltSize()
|
void |
setFormatter(PBKDF2Formatter formatter)
|
void |
setSaltSize(int saltSize)
Set the desired salt size. |
boolean |
verifyKeyFormatted(java.lang.String formatted,
java.lang.String candidatePassword)
Verification function. |
| Methods inherited from class de.rtner.security.auth.spi.PBKDF2Engine |
|---|
_F, assertPRF, ceil, deriveKey, deriveKey, getParameters, getPseudoRandomFunction, INT, main, PBKDF2, setParameters, setPseudoRandomFunction, verifyKey, xor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int saltSize
protected java.security.SecureRandom sr
protected PBKDF2Formatter formatter
| Constructor Detail |
|---|
public SimplePBKDF2()
protected SimplePBKDF2(int saltSize,
PBKDF2Parameters parameters)
saltSize - Salt size.parameters - Parameters object.
public SimplePBKDF2(int saltSize,
int iterationCount)
saltSize - Salt size.iterationCount - Iteration count.| Method Detail |
|---|
public PBKDF2Formatter getFormatter()
public void setFormatter(PBKDF2Formatter formatter)
public int getSaltSize()
public void setSaltSize(int saltSize)
saltSize - Must be positive. Zero or less are rejected.public java.lang.String deriveKeyFormatted(java.lang.String inputPassword)
inputPassword - The password to derive key from.
protected byte[] generateSalt()
public boolean verifyKeyFormatted(java.lang.String formatted,
java.lang.String candidatePassword)
formatted - "salt:iteration-count:derived-key" (depends on
effective formatter). This value should come from server-side
storage.candidatePassword - The password that is checked against the formatted reference
data. This value will usually be supplied by the
"user" or "client".
true verification OK. false
verification failed or formatter unable to decode input value as
PBKDF2 parameters.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||