Class FipsDSA.DomainParametersValidator

  • Enclosing class:
    FipsDSA

    public static final class FipsDSA.DomainParametersValidator
    extends java.lang.Object
    Domain parameter validator for DSA.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isPartiallyValidG​(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)
      Do a partial validation of g against p and q.
      boolean isValidG​(java.math.BigInteger p, java.math.BigInteger q, byte[] seed, int index, java.math.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​(java.math.BigInteger p, java.math.BigInteger q, byte[] seed, int counter)
      Validate P and Q against the passed in seed and counter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DomainParametersValidator

        public DomainParametersValidator​(FipsDigestAlgorithm digestAlgorithm,
                                         java.security.SecureRandom random)
        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,
                                         java.security.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 Detail

      • isValidPAndQ

        public boolean isValidPAndQ​(java.math.BigInteger p,
                                    java.math.BigInteger q,
                                    byte[] seed,
                                    int counter)
        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

        public boolean isPartiallyValidG​(java.math.BigInteger p,
                                         java.math.BigInteger q,
                                         java.math.BigInteger g)
        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

        public boolean isValidG​(java.math.BigInteger p,
                                java.math.BigInteger q,
                                byte[] seed,
                                int index,
                                java.math.BigInteger g)
        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.