Package org.bouncycastle.crypto.fips
Class FipsDSA.DomainParametersValidator
java.lang.Object
org.bouncycastle.crypto.fips.FipsDSA.DomainParametersValidator
- Enclosing class:
- FipsDSA
Domain parameter validator for DSA.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionDomainParametersValidator
(FipsDigestAlgorithm digestAlgorithm, SecureRandom random) Base constructor - for 186-4DomainParametersValidator
(FipsDSA.DomainParametersValidator.Version version, FipsDigestAlgorithm digestAlgorithm, SecureRandom random) Base constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
isPartiallyValidG
(BigInteger p, BigInteger q, BigInteger g) Do a partial validation of g against p and q.boolean
isValidG
(BigInteger p, BigInteger q, byte[] seed, int index, BigInteger g) Do a full validation of g against p and q by including the seed and index associated with g's related parameters.boolean
isValidPAndQ
(BigInteger p, BigInteger q, byte[] seed, int counter) Validate P and Q against the passed in seed and counter.
-
Constructor Details
-
DomainParametersValidator
Base constructor - for 186-4- Parameters:
digestAlgorithm
- digest to use in prime calculations.random
- source of randomness for prime number testing.
-
DomainParametersValidator
public DomainParametersValidator(FipsDSA.DomainParametersValidator.Version version, FipsDigestAlgorithm digestAlgorithm, SecureRandom random) Base constructor.- Parameters:
version
- the version of DSS the validator is for.digestAlgorithm
- digest to use in prime calculations.random
- source of randomness for prime number testing.
-
-
Method Details
-
isValidPAndQ
Validate P and Q against the passed in seed and counter.- Parameters:
p
- the prime P.q
- the prime Q.seed
- the seed P and Q were derived from.counter
- the number of iterations required to derive P.- Returns:
- true if the P and Q values are the expected ones, false otherwise.
-
isPartiallyValidG
Do a partial validation of g against p and q.- Parameters:
p
- the prime P.q
- the prime Q.g
- the generator G associated with P and Q.- Returns:
- true if the generator is partially valid, false otherwise.
-
isValidG
Do a full validation of g against p and q by including the seed and index associated with g's related parameters.- Parameters:
p
- the prime P.q
- the prime Q.seed
- the domain parameter seed used to generate p and q.index
- the 8 bit usage index for G.g
- the generator G associated with P and Q.- Returns:
- true if the generator is partially valid, false otherwise.
-