iaik.security.spec
Class PBEKeyAndParameterSpec

java.lang.Object
  |
  +--iaik.security.spec.PBEKeyAndParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class PBEKeyAndParameterSpec
extends Object
implements AlgorithmParameterSpec

This class is simply a combination of PBEParameterSpec and PBEKeySpec since both specs are needed when generating a SecretKey for a MAC. Typically a MAC SecretKey depends on a user specified password, a salt value and an iteration count.

Version:
File Revision 13

Constructor Summary
PBEKeyAndParameterSpec(byte[] password, byte[] salt, int iterationCount, int derivedKeyLength)
          Constructs a parameter set for password-based encryption for generating MAC secret keys.
 
Method Summary
 int getDerivedKeyLength()
          Returns the length the derived key should have.
 int getIterationCount()
          Returns the iteration count.
 byte[] getPassword()
          Returns the password.
 byte[] getSalt()
          Returns the salt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBEKeyAndParameterSpec

public PBEKeyAndParameterSpec(byte[] password,
                              byte[] salt,
                              int iterationCount,
                              int derivedKeyLength)
Constructs a parameter set for password-based encryption for generating MAC secret keys. Note that the given password and the salt are cloned before they are stored in the new MACParameterSpec object.
Parameters:
password - the password
salt - the salt
iterationCount - the iteration count
derivedKeyLength - the length the derived key should have
Method Detail

getIterationCount

public final int getIterationCount()
Returns the iteration count.

getDerivedKeyLength

public final int getDerivedKeyLength()
Returns the length the derived key should have.

getSalt

public final byte[] getSalt()
Returns the salt.

getPassword

public final byte[] getPassword()
Returns the password. Note that this method returns a reference to the password. It is the caller's responsibility to zero out the password information after it is no longer needed.

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK