Class DHDomainParameters

java.lang.Object
org.bouncycastle.crypto.asymmetric.DHDomainParameters

public class DHDomainParameters extends Object
Container class for Diffie-Hellman domain parameters.
  • Constructor Details

    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger g)
      Minimal usable parameters.
      Parameters:
      p - the prime p defining the Galois field.
      g - the generator of the multiplicative subgroup of order g.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger g, int l)
      Minimal usable parameters with a private value length (PKCS#3).
      Parameters:
      p - the prime p defining the Galois field.
      g - the generator of the multiplicative subgroup of order g.
      l - the maximum bit length for the private value.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g)
      Minimal constructor for parameters able to be used to verify a public key.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g, int l)
      Minimal constructor for parameters able to be used to verify a public key with a private value length.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
      l - the maximum bit length for the private value.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g, int m, int l)
      Parameters which can verify a public key with private value lengths.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
      m - the minimum bit length for the private value.
      l - the maximum bit length for the private value.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g, BigInteger j, DHValidationParameters validation)
      Standard constructor - the full X9.42 parameter set.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
      j - optionally specifies the value that satisfies the equation p = jq+1
      validation - parameters for validating these domain parameters.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g, int l, DHValidationParameters validation)
      X9.42 parameters with private value length.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
      l - the maximum bit length for the private value.
      validation - parameters for validating these domain parameters.
    • DHDomainParameters

      public DHDomainParameters(BigInteger p, BigInteger q, BigInteger g, int m, int l, BigInteger j, DHValidationParameters validation)
      Base constructor - the full domain parameter set.
      Parameters:
      p - the prime p defining the Galois field.
      q - specifies the prime factor of p - 1.
      g - the generator of the multiplicative subgroup of order g.
      m - the minimum bit length for the private value.
      l - the maximum bit length for the private value.
      j - optionally specifies the value that satisfies the equation p = jq+1
      validation - parameters for validating these domain parameters.
  • Method Details

    • getP

      public BigInteger getP()
      Return the prime p defining the Galois field.
      Returns:
      the prime p.
    • getG

      public BigInteger getG()
      Return the generator of the multiplicative subgroup of order g.
      Returns:
      the generator g.
    • getQ

      public BigInteger getQ()
      Return q, the prime factor of p - 1
      Returns:
      q value
    • getJ

      public BigInteger getJ()
      Return the subgroup factor J, which satisifes the equation p=jq+1, if present.
      Returns:
      subgroup factor, or null.
    • getM

      public int getM()
      Return the minimum length of the private value.
      Returns:
      the minimum length of the private value in bits.
    • getL

      public int getL()
      Return the private value length in bits - if set, zero otherwise
      Returns:
      the private value length in bits, zero otherwise.
    • getValidationParameters

      public DHValidationParameters getValidationParameters()
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object