org.mozilla.jss.crypto

Class PBEKeyGenParams

public class PBEKeyGenParams extends Object implements AlgorithmParameterSpec, KeySpec

Constructor Summary
PBEKeyGenParams(Password pass, byte[] salt, int iterations)
Creates PBE parameters.
PBEKeyGenParams(char[] pass, byte[] salt, int iterations)
Creates PBE parameters.
Method Summary
voidclear()
Clears the password.
protected voidfinalize()
intgetIterations()
Returns the iteration count.
PasswordgetPassword()
Returns a reference to the password, not a copy.
byte[]getSalt()
Returns a reference to the salt.

Constructor Detail

PBEKeyGenParams

public PBEKeyGenParams(Password pass, byte[] salt, int iterations)
Creates PBE parameters.

Parameters: pass The password. It will be cloned, so the caller is still responsible for clearing it. It must not be null. salt The salt for the PBE algorithm. Will not be cloned. Must not be null. It is the responsibility of the caller to use the right salt length for the algorithm. Most algorithms use 8 bytes of salt. The iteration count for the PBE algorithm.

PBEKeyGenParams

public PBEKeyGenParams(char[] pass, byte[] salt, int iterations)
Creates PBE parameters.

Parameters: pass The password. It will be cloned, so the caller is still responsible for clearing it. It must not be null. salt The salt for the PBE algorithm. Will not be cloned. Must not be null. It is the responsibility of the caller to use the right salt length for the algorithm. Most algorithms use 8 bytes of salt. The iteration count for the PBE algorithm.

Method Detail

clear

public void clear()
Clears the password. This should be called when this object is no longer needed so the password is not left around in memory.

finalize

protected void finalize()

getIterations

public int getIterations()
Returns the iteration count.

getPassword

public Password getPassword()
Returns a reference to the password, not a copy.

getSalt

public byte[] getSalt()
Returns a reference to the salt.