You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.




org.mozilla.jss.crypto
Class PBEKeyGenParams

java.lang.Object
  extended by org.mozilla.jss.crypto.PBEKeyGenParams
All Implemented Interfaces:
java.security.spec.AlgorithmParameterSpec, java.security.spec.KeySpec

public class PBEKeyGenParams
extends java.lang.Object
implements java.security.spec.AlgorithmParameterSpec, java.security.spec.KeySpec


Constructor Summary
PBEKeyGenParams(char[] pass, byte[] salt, int iterations)
          Creates PBE parameters.
PBEKeyGenParams(Password pass, byte[] salt, int iterations)
          Creates PBE parameters.
 
Method Summary
 void clear()
          Clears the password.
protected  void finalize()
           
 int getIterations()
          Returns the iteration count.
 Password getPassword()
          Returns a reference to the password, not a copy.
 byte[] getSalt()
          Returns a reference to the salt.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getPassword

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


getSalt

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


getIterations

public int getIterations()
Returns the iteration count.


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()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable