Class DHDomainParameterSpec

  • All Implemented Interfaces:
    java.security.spec.AlgorithmParameterSpec

    public class DHDomainParameterSpec
    extends javax.crypto.spec.DHParameterSpec
    Extension class for DHParameterSpec that wraps a DHDomainParameters object and provides the q domain parameter.
    • Constructor Summary

      Constructors 
      Constructor Description
      DHDomainParameterSpec​(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)
      Minimal constructor for parameters able to be used to verify a public key, or use with MQV.
      DHDomainParameterSpec​(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, int l)
      Minimal constructor for parameters able to be used to verify a public key, or use with MQV, and a private value length.
      DHDomainParameterSpec​(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger j, int l)
      X9.42 parameters with private value length.
      DHDomainParameterSpec​(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger j, int m, int l)
      Base constructor - the full domain parameter set.
      DHDomainParameterSpec​(DHParameters domainParameters)
      Base constructor - use the values in an existing set of domain parameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      DHParameters getDomainParameters()
      Return the DHDomainParameters object we represent.
      java.math.BigInteger getJ()
      Return the J value for the domain parameter set if available.
      int getM()
      Return the minimum bitlength for a private value to be generated from these parameters, 0 if not set.
      java.math.BigInteger getQ()
      Return the Q value for the domain parameter set.
      • Methods inherited from class javax.crypto.spec.DHParameterSpec

        getG, getL, getP
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DHDomainParameterSpec

        public DHDomainParameterSpec​(DHParameters domainParameters)
        Base constructor - use the values in an existing set of domain parameters.
        Parameters:
        domainParameters - the Diffie-Hellman domain parameters to wrap.
      • DHDomainParameterSpec

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

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

        public DHDomainParameterSpec​(java.math.BigInteger p,
                                     java.math.BigInteger q,
                                     java.math.BigInteger g,
                                     java.math.BigInteger j,
                                     int l)
        X9.42 parameters with private value length.
        Parameters:
        p - the prime p defining the Galois field.
        g - the generator of the multiplicative subgroup of order g.
        q - specifies the prime factor of p - 1
        j - optionally specifies the value that satisfies the equation p = jq+1
        l - the maximum bit length for the private value.
      • DHDomainParameterSpec

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

      • getQ

        public java.math.BigInteger getQ()
        Return the Q value for the domain parameter set.
        Returns:
        the value Q.
      • getJ

        public java.math.BigInteger getJ()
        Return the J value for the domain parameter set if available.
        Returns:
        the value J, null otherwise.
      • getM

        public int getM()
        Return the minimum bitlength for a private value to be generated from these parameters, 0 if not set.
        Returns:
        minimum bitlength for private value.
      • getDomainParameters

        public DHParameters getDomainParameters()
        Return the DHDomainParameters object we represent.
        Returns:
        the internal DHDomainParameters.