Class DHParameterSpec

java.lang.Object
javax.crypto.spec.DHParameterSpec
All Implemented Interfaces:
AlgorithmParameterSpec

public class DHParameterSpec
extends Object
implements AlgorithmParameterSpec
The algorithm parameter specification for the Diffie-Hellman algorithm.
  • Constructor Details

    • DHParameterSpec

      public DHParameterSpec​(BigInteger p, BigInteger g)
      Creates a new DHParameterSpec instance with the specified prime modulus and base generator.
      Parameters:
      p - the prime modulus.
      g - the base generator.
    • DHParameterSpec

      public DHParameterSpec​(BigInteger p, BigInteger g, int l)
      Creates a new DHParameterSpec instance with the specified prime modulus, base generator and size (in bits) of the random exponent.
      Parameters:
      p - the prime modulus.
      g - the base generator.
      l - the size of the random exponent (in bits).
  • Method Details

    • getP

      public BigInteger getP()
      Returns the prime modulus of this parameter specification.
      Returns:
      the prime modulus.
    • getG

      public BigInteger getG()
      Returns the base generator of this parameter specification.
      Returns:
      the base generator.
    • getL

      public int getL()
      Returns the size (in bits) of the random exponent.
      Returns:
      the size (in bits) of the random exponent.