Class DHDomainParameters
java.lang.Object
org.bouncycastle.crypto.asymmetric.DHDomainParameters
Container class for Diffie-Hellman domain parameters.
-
Constructor Summary
ConstructorsConstructorDescriptionMinimal usable parameters.DHDomainParameters
(BigInteger p, BigInteger g, int l) Minimal usable parameters with a private value length (PKCS#3).DHDomainParameters
(BigInteger p, BigInteger q, BigInteger g) Minimal constructor for parameters able to be used to verify a public key.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.DHDomainParameters
(BigInteger p, BigInteger q, BigInteger g, int m, int l) Parameters which can verify a public key with private value lengths.DHDomainParameters
(BigInteger p, BigInteger q, BigInteger g, int m, int l, BigInteger j, DHValidationParameters validation) Base constructor - the full domain parameter set.DHDomainParameters
(BigInteger p, BigInteger q, BigInteger g, int l, DHValidationParameters validation) X9.42 parameters with private value length.DHDomainParameters
(BigInteger p, BigInteger q, BigInteger g, BigInteger j, DHValidationParameters validation) Standard constructor - the full X9.42 parameter set. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getG()
Return the generator of the multiplicative subgroup of order g.getJ()
Return the subgroup factor J, which satisifes the equation p=jq+1, if present.int
getL()
Return the private value length in bits - if set, zero otherwiseint
getM()
Return the minimum length of the private value.getP()
Return the prime p defining the Galois field.getQ()
Return q, the prime factor of p - 1int
hashCode()
-
Constructor Details
-
DHDomainParameters
Minimal usable parameters.- Parameters:
p
- the prime p defining the Galois field.g
- the generator of the multiplicative subgroup of order g.
-
DHDomainParameters
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
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
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
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+1validation
- 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+1validation
- parameters for validating these domain parameters.
-
-
Method Details
-
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 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
-
equals
-
hashCode
public int hashCode()
-