com.ibm.crypto.fips.provider

Class DHKeyPairGenerator

  1. java.lang.Object
  2. extended byjava.security.KeyPairGeneratorSpi
  3. extended bycom.ibm.crypto.fips.provider.DHKeyPairGenerator
All implemented interfaces:
AlgorithmStatus

  1. public final class DHKeyPairGenerator
  2. extends java.security.KeyPairGeneratorSpi
  3. implements AlgorithmStatus
This class represents the key pair generator for Diffie-Hellman key pairs.

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

Author:
Jan Luehe, John Peck
See Also:
KeyPairGenerator

Constructor Summary

Constructor and Description
DHKeyPairGenerator()

Method Summary

Modifier and Type Method and Description
  1. java.security.KeyPair
generateKeyPair()
Generates a key pair.
  1. void
initialize(java.security.spec.AlgorithmParameterSpec params,java.security.SecureRandom random)
Initializes this key pair generator for the specified parameter set and source of randomness.
  1. void
initialize(int keysize,java.security.SecureRandom random)
Initializes this key pair generator for a certain keysize and source of randomness.
  1. protected
  2. java.security.KeyPair
internalGenerateKeyPair()
Generates a key pair.
  1. protected
  2. void
internalInitialize(java.security.spec.AlgorithmParameterSpec params,java.security.SecureRandom random)
Initializes this key pair generator for the specified parameter set and source of randomness.
  1. protected
  2. void
internalInitialize(int keysize,java.security.SecureRandom random)
Initializes this key pair generator for a certain keysize and source of randomness.
  1. boolean
isFipsApproved()
This function allows an application to verify the the algorithm is FIPS approved.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DHKeyPairGenerator

  1. public DHKeyPairGenerator()

Method Detail

initialize

  1. public void initialize(int keysize,
  2. java.security.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 java.security.KeyPairGeneratorSpi
Parameters:
keysize - the keysize (size of prime modulus) in bits
random - the source of randomness

internalInitialize

  1. protected void internalInitialize( int keysize,
  2. java.security.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.
Parameters:
keysize - the keysize (size of prime modulus) in bits
random - the source of randomness

isFipsApproved

  1. public boolean isFipsApproved()
This function allows an application to verify the the algorithm is FIPS approved.
Specified by:
See Also:

initialize

  1. public void initialize(java.security.spec.AlgorithmParameterSpec params,
  2. java.security.SecureRandom random)
  3. throws java.security.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 java.security.KeyPairGeneratorSpi
Parameters:
params - the parameter set used to generate the key pair
random - the source of randomness
Throws:
java.security.InvalidAlgorithmParameterException - if the given parameters are inappropriate for this key pair generator

internalInitialize

  1. protected void internalInitialize( java.security.spec.AlgorithmParameterSpec params,
  2. java.security.SecureRandom random)
  3. throws java.security.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).

Parameters:
params - the parameter set used to generate the key pair
random - the source of randomness
Throws:
java.security.InvalidAlgorithmParameterException - if the given parameters are inappropriate for this key pair generator

generateKeyPair

  1. public java.security.KeyPair generateKeyPair( )
Generates a key pair.
Specified by:
generateKeyPair in class java.security.KeyPairGeneratorSpi
Returns:
the new key pair

internalGenerateKeyPair

  1. protected java.security.KeyPair internalGenerateKeyPair( )
Generates a key pair.
Returns:
the new key pair