Package org.bouncycastle.asn1.x9
Class DomainParameters
java.lang.Object
org.bouncycastle.asn1.ASN1Object
org.bouncycastle.asn1.x9.DomainParameters
- All Implemented Interfaces:
ASN1Encodable
,Encodable
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 Summary
ConstructorsConstructorDescriptionDomainParameters
(BigInteger p, BigInteger g, BigInteger q, BigInteger j, ValidationParams validationParams) Base constructor - the full domain parameter set. -
Method Summary
Modifier and TypeMethodDescriptiongetG()
Return the generator of the multiplicative subgroup of order g.static DomainParameters
getInstance
(Object obj) Return a DomainParameters object from the passed in object.static DomainParameters
getInstance
(ASN1TaggedObject obj, boolean explicit) Return a DomainParameters object from the passed in tagged object.getJ()
Return the value that satisfies the equation p = jq+1 (if present).getP()
Return the prime p defining the Galois field.getQ()
Return q, the prime factor of p - 1Return the validation parameters for this set (if present).Return an ASN.1 primitive representation of this object.Methods inherited from class org.bouncycastle.asn1.ASN1Object
encodeTo, encodeTo, equals, getEncoded, getEncoded, hasEncodedTagValue, hashCode
-
Constructor Details
-
DomainParameters
public DomainParameters(BigInteger p, BigInteger g, BigInteger q, 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 - 1j
- optionally specifies the value that satisfies the equation p = jq+1validationParams
- parameters for validating these domain parameters.
-
-
Method Details
-
getInstance
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
Return a DomainParameters object from the passed in object.- Parameters:
obj
- an object for conversion or a byte[].- Returns:
- a DomainParameters
-
getP
Return the prime p defining the Galois field.- Returns:
- the prime p.
-
getG
Return the generator of the multiplicative subgroup of order g.- Returns:
- the generator g.
-
getQ
Return q, the prime factor of p - 1- Returns:
- q value
-
getJ
Return the value that satisfies the equation p = jq+1 (if present).- Returns:
- j value or null.
-
getValidationParams
Return the validation parameters for this set (if present).- Returns:
- validation parameters, or null if absent.
-
toASN1Primitive
Return an ASN.1 primitive representation of this object.- Specified by:
toASN1Primitive
in interfaceASN1Encodable
- Specified by:
toASN1Primitive
in classASN1Object
- Returns:
- a DERSequence containing the parameter values.
-