de.rtner.security.auth.spi
Interface PBKDF2

All Known Implementing Classes:
PBKDF2Engine, SimplePBKDF2

public interface PBKDF2

Interface to Password Based Key Derivation Function 2 implementations.

Since:
1.0

Method Summary
 byte[] deriveKey(java.lang.String inputPassword)
          Convert String-based input to internal byte array, then invoke PBKDF2.
 byte[] deriveKey(java.lang.String inputPassword, int dkLen)
          Convert String-based input to internal byte array, then invoke PBKDF2.
 PBKDF2Parameters getParameters()
          Allow reading of configured parameters.
 PRF getPseudoRandomFunction()
          Get currently set Pseudo Random Function.
 void setParameters(PBKDF2Parameters parameters)
          Allow setting of configured parameters.
 void setPseudoRandomFunction(PRF prf)
          Set the Pseudo Random Function to use.
 boolean verifyKey(java.lang.String inputPassword)
          Convert String-based input to internal byte arrays, then invoke PBKDF2 and verify result against the reference data that is supplied in the PBKDF2Parameters.
 

Method Detail

deriveKey

byte[] deriveKey(java.lang.String inputPassword)
Convert String-based input to internal byte array, then invoke PBKDF2. Desired key length defaults to Pseudo Random Function block size.

Parameters:
inputPassword - Candidate password to compute the derived key for.
Returns:
internal byte array

deriveKey

byte[] deriveKey(java.lang.String inputPassword,
                 int dkLen)
Convert String-based input to internal byte array, then invoke PBKDF2.

Parameters:
inputPassword - Candidate password to compute the derived key for.
dkLen - Specify desired key length
Returns:
internal byte array

verifyKey

boolean verifyKey(java.lang.String inputPassword)
Convert String-based input to internal byte arrays, then invoke PBKDF2 and verify result against the reference data that is supplied in the PBKDF2Parameters.

Parameters:
inputPassword - Candidate password to compute the derived key for.
Returns:
true password match; false incorrect password

getParameters

PBKDF2Parameters getParameters()
Allow reading of configured parameters.

Returns:
Currently set parameters.

setParameters

void setParameters(PBKDF2Parameters parameters)
Allow setting of configured parameters.

Parameters:
parameters - The parameters object to set.

getPseudoRandomFunction

PRF getPseudoRandomFunction()
Get currently set Pseudo Random Function.

Returns:
Currently set Pseudo Random Function

setPseudoRandomFunction

void setPseudoRandomFunction(PRF prf)
Set the Pseudo Random Function to use. Note that deriveKeys/getPRF does init this object using the supplied candidate password. If this is undesired, one has to override getPRF.

Parameters:
prf - Pseudo Random Function to set.