de.rtner.security.auth.spi
Class PBKDF2Parameters

java.lang.Object
  extended by de.rtner.security.auth.spi.PBKDF2Parameters

public class PBKDF2Parameters
extends java.lang.Object

Parameter data holder for PBKDF2 configuration.


Field Summary
protected  byte[] derivedKey
          The derived key is actually only a convenience to store a reference derived key.
protected  java.lang.String hashAlgorithm
           
protected  java.lang.String hashCharset
           
protected  int iterationCount
           
protected  byte[] salt
           
 
Constructor Summary
PBKDF2Parameters()
          Constructor.
PBKDF2Parameters(java.lang.String hashAlgorithm, java.lang.String hashCharset, byte[] salt, int iterationCount)
          Constructor.
PBKDF2Parameters(java.lang.String hashAlgorithm, java.lang.String hashCharset, byte[] salt, int iterationCount, byte[] derivedKey)
          Constructor.
 
Method Summary
 byte[] getDerivedKey()
           
 java.lang.String getHashAlgorithm()
           
 java.lang.String getHashCharset()
           
 int getIterationCount()
           
 byte[] getSalt()
           
 void setDerivedKey(byte[] derivedKey)
           
 void setHashAlgorithm(java.lang.String hashAlgorithm)
           
 void setHashCharset(java.lang.String hashCharset)
           
 void setIterationCount(int iterationCount)
           
 void setSalt(byte[] salt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

salt

protected byte[] salt

iterationCount

protected int iterationCount

hashAlgorithm

protected java.lang.String hashAlgorithm

hashCharset

protected java.lang.String hashCharset

derivedKey

protected byte[] derivedKey
The derived key is actually only a convenience to store a reference derived key. It is not used during computation.

Constructor Detail

PBKDF2Parameters

public PBKDF2Parameters()
Constructor. Defaults to null for byte arrays, UTF-8 as character set and 1000 for iteration count.


PBKDF2Parameters

public PBKDF2Parameters(java.lang.String hashAlgorithm,
                        java.lang.String hashCharset,
                        byte[] salt,
                        int iterationCount)
Constructor.

Parameters:
hashAlgorithm - for example HMacSHA1 or HMacMD5
hashCharset - for example UTF-8
salt - Salt as byte array, may be null (not recommended)
iterationCount - Number of iterations to execute. Recommended value 1000.

PBKDF2Parameters

public PBKDF2Parameters(java.lang.String hashAlgorithm,
                        java.lang.String hashCharset,
                        byte[] salt,
                        int iterationCount,
                        byte[] derivedKey)
Constructor.

Parameters:
hashAlgorithm - for example HMacSHA1 or HMacMD5
hashCharset - for example UTF-8
salt - Salt as byte array, may be null (not recommended)
iterationCount - Number of iterations to execute. Recommended value 1000.
derivedKey - Convenience data holder, not used during computation.
Method Detail

getIterationCount

public int getIterationCount()

setIterationCount

public void setIterationCount(int iterationCount)

getSalt

public byte[] getSalt()

setSalt

public void setSalt(byte[] salt)

getDerivedKey

public byte[] getDerivedKey()

setDerivedKey

public void setDerivedKey(byte[] derivedKey)

getHashAlgorithm

public java.lang.String getHashAlgorithm()

setHashAlgorithm

public void setHashAlgorithm(java.lang.String hashAlgorithm)

getHashCharset

public java.lang.String getHashCharset()

setHashCharset

public void setHashCharset(java.lang.String hashCharset)