Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-04


oracle.security.crypto.core
Class DHParameterGenerator

java.lang.Object
  extended by oracle.security.crypto.core.DHParameterGenerator


public class DHParameterGenerator
extends java.lang.Object

Performs normative generation of (static) Diffie-Hellman domain parameters, as specified in X9.42.

Normally, Diffie-Hellmain parameters are distributed (and generated) by a central agency agreed upon by participating parties, so a DHParameterGenerator will be invoked far less often than, say, a generator for RSA, DSA (or DH) keypairs.

Parameter generation is also similarly resource intensive: for example, generation of the sample parameters given in Annex D of X9.42 takes about 100 seconds on a Pentium-based JVM.

See Also:
DHParams

Constructor Summary
DHParameterGenerator()
          Constructs a new, uninitialized DHParameterGenerator instance.

 

Method Summary
 DHParams generateParameters()
          Generates Diffie-Hellman parameters using the algorithms specified in Annex B, X9.42.
 java.lang.String getAlgorithm()
          Returns "Diffie-Hellman".
 void initialize(int L, int m)
          Initialize this DHParameterGenerator with the given bit lengths for p and q, and the default RandomBitsSource.
 void initialize(int L, int m, RandomBitsSource rbs)
          Initialize this DHParameterGenerator of the given bit lengths and RandomBitsSource.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

DHParameterGenerator

public DHParameterGenerator()
Constructs a new, uninitialized DHParameterGenerator instance.

Method Detail

initialize

public void initialize(int L,
                       int m)
Initialize this DHParameterGenerator with the given bit lengths for p and q, and the default RandomBitsSource.
Parameters:
L - the bit length of p; L=256n, n>=4
m - the bit length of q; m>=160

initialize

public void initialize(int L,
                       int m,
                       RandomBitsSource rbs)
Initialize this DHParameterGenerator of the given bit lengths and RandomBitsSource.
Parameters:
L - the bit length of p; L=256n, n>=4
m - the bit length of q; m>=160
rbs - the random bit source used to generate the parameters

getAlgorithm

public java.lang.String getAlgorithm()
Returns "Diffie-Hellman".

generateParameters

public DHParams generateParameters()
Generates Diffie-Hellman parameters using the algorithms specified in Annex B, X9.42. The generator instance should be initialized before this method is invoked (otherwise an exception is thrown.)
Returns:
A DHParams object of the specified sizes.

Skip navigation links

Oracle Fusion Middleware Crypto Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10668-04


Copyright © 2005, 2011 , Oracle. All rights reserved.