com.ibm.crypto.provider
Class HmacMD5KeyGenerator

java.lang.Object
  extended by javax.crypto.KeyGeneratorSpi
      extended by com.ibm.crypto.provider.HmacMD5KeyGenerator

public final class HmacMD5KeyGenerator
extends KeyGeneratorSpi

This class generates a secret key for use with the HMAC-MD5 algorithm.


Constructor Summary
HmacMD5KeyGenerator()
          Verify the JCE framework in the constructor.
 
Method Summary
protected  SecretKey engineGenerateKey()
          Generates an HMAC-MD5 key.
protected  void engineInit(AlgorithmParameterSpec params, SecureRandom random)
          Initializes this key generator with the specified parameter set and a user-provided source of randomness.
protected  void engineInit(int keysize, SecureRandom random)
          Initializes this key generator for a certain keysize, using the given source of randomness.
protected  void engineInit(SecureRandom random)
          Initializes this key generator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HmacMD5KeyGenerator

public HmacMD5KeyGenerator()
Verify the JCE framework in the constructor.

Throws:
SecurityException - if fails to verify the JCE framework.
Method Detail

engineInit

protected void engineInit(SecureRandom random)
Initializes this key generator.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
random - the source of randomness for this generator

engineInit

protected void engineInit(AlgorithmParameterSpec params,
                          SecureRandom random)
                   throws InvalidAlgorithmParameterException
Initializes this key generator with the specified parameter set and a user-provided source of randomness.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
params - the key generation parameters
random - the source of randomness for this key generator
Throws:
InvalidAlgorithmParameterException - if params is inappropriate for this key generator

engineInit

protected void engineInit(int keysize,
                          SecureRandom random)
Initializes this key generator for a certain keysize, using the given source of randomness.

Specified by:
engineInit in class KeyGeneratorSpi
Parameters:
keysize - the keysize. This is an algorithm-specific metric specified in number of bits.
random - the source of randomness for this key generator

engineGenerateKey

protected SecretKey engineGenerateKey()
Generates an HMAC-MD5 key.

Specified by:
engineGenerateKey in class KeyGeneratorSpi
Returns:
the new HMAC-MD5 key