Class DHDomainParameters
- java.lang.Object
-
- org.bouncycastle.crypto.asymmetric.DHDomainParameters
-
public class DHDomainParameters extends java.lang.ObjectContainer class for Diffie-Hellman domain parameters.
-
-
Constructor Summary
Constructors Constructor Description DHDomainParameters(java.math.BigInteger p, java.math.BigInteger g)Minimal usable parameters.DHDomainParameters(java.math.BigInteger p, java.math.BigInteger g, int l)Minimal usable parameters with a private value length (PKCS#3).DHDomainParameters(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.DHDomainParameters(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 with a private value length.DHDomainParameters(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, int m, int l)Parameters which can verify a public key with private value lengths.DHDomainParameters(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, int m, int l, java.math.BigInteger j, DHValidationParameters validation)Base constructor - the full domain parameter set.DHDomainParameters(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, int l, DHValidationParameters validation)X9.42 parameters with private value length.DHDomainParameters(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.BigInteger j, DHValidationParameters validation)Standard constructor - the full X9.42 parameter set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.math.BigIntegergetG()Return the generator of the multiplicative subgroup of order g.java.math.BigIntegergetJ()Return the subgroup factor J, which satisifes the equation p=jq+1, if present.intgetL()Return the private value length in bits - if set, zero otherwiseintgetM()Return the minimum length of the private value.java.math.BigIntegergetP()Return the prime p defining the Galois field.java.math.BigIntegergetQ()Return q, the prime factor of p - 1DHValidationParametersgetValidationParameters()inthashCode()
-
-
-
Constructor Detail
-
DHDomainParameters
public DHDomainParameters(java.math.BigInteger p, java.math.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(java.math.BigInteger p, java.math.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(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.- 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(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 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(java.math.BigInteger p, java.math.BigInteger q, java.math.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(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, java.math.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+1validation- parameters for validating these domain parameters.
-
DHDomainParameters
public DHDomainParameters(java.math.BigInteger p, java.math.BigInteger q, java.math.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(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g, int m, int l, java.math.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+1validation- parameters for validating these domain parameters.
-
-
Method Detail
-
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 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(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-