com.ibm.crypto.provider
Class DHKeyPairGenerator

java.lang.Object
  extended by java.security.KeyPairGeneratorSpi
      extended by com.ibm.crypto.provider.DHKeyPairGenerator

public final class DHKeyPairGenerator
extends KeyPairGeneratorSpi

This class represents the key pair generator for Diffie-Hellman key pairs.

This key pair generator may be initialized in two different ways:

See Also:
KeyPairGenerator

Constructor Summary
DHKeyPairGenerator()
           
 
Method Summary
 KeyPair generateKeyPair()
          Generates a key pair.
 void initialize(AlgorithmParameterSpec params, SecureRandom random)
          Initializes this key pair generator for the specified parameter set and source of randomness.
 void initialize(int keysize, SecureRandom random)
          Initializes this key pair generator for a certain keysize and source of randomness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DHKeyPairGenerator

public DHKeyPairGenerator()
Method Detail

initialize

public void initialize(int keysize,
                       SecureRandom random)
Initializes this key pair generator for a certain keysize and source of randomness. The keysize is specified as the size in bits of the prime modulus.

Specified by:
initialize in class KeyPairGeneratorSpi
Parameters:
keysize - the keysize (size of prime modulus) in bits
random - the source of randomness

initialize

public void initialize(AlgorithmParameterSpec params,
                       SecureRandom random)
                throws InvalidAlgorithmParameterException
Initializes this key pair generator for the specified parameter set and source of randomness.

The given parameter set contains the prime modulus, the base generator, and optionally the requested size in bits of the random exponent (private value).

Overrides:
initialize in class KeyPairGeneratorSpi
Parameters:
params - the parameter set used to generate the key pair
random - the source of randomness w
Throws:
InvalidAlgorithmParameterException - if the given parameters are inappropriate for this key pair generator

generateKeyPair

public KeyPair generateKeyPair()
Generates a key pair.

Specified by:
generateKeyPair in class KeyPairGeneratorSpi
Returns:
the new key pair