Class DomainParameters

  • All Implemented Interfaces:
    ASN1Encodable, Encodable

    public class DomainParameters
    extends ASN1Object
    X9.44 Diffie-Hellman domain parameters.
        DomainParameters ::= SEQUENCE {
           p                INTEGER,           -- odd prime, p=jq +1
           g                INTEGER,           -- generator, g
           q                INTEGER,           -- factor of p-1
           j                INTEGER OPTIONAL,  -- subgroup factor, j >= 2
           validationParams  ValidationParams OPTIONAL
        }
     
    • Constructor Detail

      • DomainParameters

        public DomainParameters​(java.math.BigInteger p,
                                java.math.BigInteger g,
                                java.math.BigInteger q,
                                java.math.BigInteger j,
                                ValidationParams validationParams)
        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
        validationParams - parameters for validating these domain parameters.
    • Method Detail

      • getInstance

        public static DomainParameters getInstance​(ASN1TaggedObject obj,
                                                   boolean explicit)
        Return a DomainParameters object from the passed in tagged object.
        Parameters:
        obj - a tagged object.
        explicit - true if the contents of the object is explictly tagged, false otherwise.
        Returns:
        a DomainParameters
      • getInstance

        public static DomainParameters getInstance​(java.lang.Object obj)
        Return a DomainParameters object from the passed in object.
        Parameters:
        obj - an object for conversion or a byte[].
        Returns:
        a DomainParameters
      • getP

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

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

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

        public java.math.BigInteger getJ()
        Return the value that satisfies the equation p = jq+1 (if present).
        Returns:
        j value or null.
      • getValidationParams

        public ValidationParams getValidationParams()
        Return the validation parameters for this set (if present).
        Returns:
        validation parameters, or null if absent.