iaik.security.pbe
Class PBEParameterGenerator

java.lang.Object
  |
  +--java.security.AlgorithmParameterGeneratorSpi
        |
        +--iaik.security.pbe.PBEParameterGenerator

public class PBEParameterGenerator
extends AlgorithmParameterGeneratorSpi

This class implements an AlgorithmParameterGenerator to be used for generating parameters for en/decrypting messages with password based encryption algorithms according to PKCS#5 and PKCS#12.

PKCS#5 describes a method for encrypting messages (octet strings) with secret keys derived from a password. For generating the key from the password, special paramters (salt an octet string and iteration count an integer) are required.

Applications shall use

 AlgorithmParameterGenerator.getInstance("PBE")
 
for obtaining an AlgorithmParameterGenerator for generating PBE parameters in opaque representation. Once the generator has been created, it shall be properly initialized by one of the several init methods. If none explicit initialization is done, per default the salt length is set to 8 bytes, and the iteration count value is set to 1. After initializing the generator (or relying on default settings), the required parameters actually are created by calling the generateParameters method.

Version:
File Revision 14
See Also:
PBEParameters, PBEGenParameterSpec, AlgorithmParameterGenerator

Constructor Summary
PBEParameterGenerator()
          The default constructor.
 
Method Summary
protected  AlgorithmParameters engineGenerateParameters()
          Actually generates the required PBE AlgorithmParameters.
protected  void engineInit(AlgorithmParameterSpec param, SecureRandom random)
          Initializes this generator with PBE-specific parameter generation values and some random seed.
protected  void engineInit(int saltLength, SecureRandom random)
          Initializes the parameter generator with given salt length and random seed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PBEParameterGenerator

public PBEParameterGenerator()
The default constructor. Only internally used for creating a PBEParameterGenerator object. Applications shall use one of the AlgorithmParameterGenerator.getInstance factory methods for obtaining an AlgorithmParamterGenerator for generating paramters for password based encryption.
Method Detail

engineInit

protected void engineInit(int saltLength,
                          SecureRandom random)
Initializes the parameter generator with given salt length and random seed. Iteration count is set to 1.
Overrides:
engineInit in class AlgorithmParameterGeneratorSpi
Parameters:
saltLength - the length of the salt in bytes
random - the random seed to be used by this generator.

engineInit

protected void engineInit(AlgorithmParameterSpec param,
                          SecureRandom random)
                   throws InvalidAlgorithmParameterException
Initializes this generator with PBE-specific parameter generation values and some random seed.

From the given parameter specification (which has to be of type PBEGenParameterSpec) salt length and iteration count are obtained for generating the algorithm parameters.

Applications shall call init(param_spec, random) for provider independently accessing this method.

Overrides:
engineInit in class AlgorithmParameterGeneratorSpi
Parameters:
param - an instance of PBEGenParameterSpec
random - the random seed to be used by this generator.
Throws:
InvalidAlgorithmParameterException - if param is not an instance of PBEGenParameterSpec

engineGenerateParameters

protected AlgorithmParameters engineGenerateParameters()
Actually generates the required PBE AlgorithmParameters.

Applications shall call generatePrameters() for provider independently accessing this method.

Overrides:
engineGenerateParameters in class AlgorithmParameterGeneratorSpi
Returns:
the new created AlgorithmParameters

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