com.ibm.crypto.fips.provider

Class DSAParameterGenerator

  • java.lang.Object
    • java.security.AlgorithmParameterGeneratorSpi
      • com.ibm.crypto.fips.provider.DSAParameterGenerator
  • All Implemented Interfaces:
    NistDSAParam


    public final class DSAParameterGenerator
    extends java.security.AlgorithmParameterGeneratorSpi
    implements NistDSAParam
    This class generates parameters for the DSA signature.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DSAParameterGenerator()
      Constructs a new instance of this class.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      protected java.security.AlgorithmParameters engineGenerateParameters()
      Answers the newly generated parameters.
      protected void engineInit(java.security.spec.AlgorithmParameterSpec genParamSpec, java.security.SecureRandom random)
      Initializes the receiver with the specified parameters and source of randomness.
      protected void engineInit(int size, java.security.SecureRandom random)
      Initializes the receiver with the specified parameter size and source of randomness.
      protected java.math.BigInteger[] generate_g_h(java.math.BigInteger p, java.math.BigInteger q)
      Generate and return g,h one of the DSA parameters
      protected ProbablePrimeResultFFC generateParameters_SP186_2(int L, java.security.MessageDigest sha, byte[] paramSeed)
      Actual generation of DSA parameters
      protected ProbablePrimeResultFFC generateParameters_SP186_4(int L, int N, java.security.MessageDigest md, byte[] paramSeed)
      Generate parameters for NIST SP186-4 specification
      protected java.security.AlgorithmParameters internalGenerateParameters()
      Answers the newly generated parameters.
      protected void internalInit(java.security.spec.AlgorithmParameterSpec genParamSpec, java.security.SecureRandom random)
      Initializes the receiver with the specified parameters and source of randomness.
      protected void internalInit(int size, java.security.SecureRandom random)
      Initializes the receiver with the specified parameter size and source of randomness.
      protected int validate_g(java.math.BigInteger p, java.math.BigInteger q, java.math.BigInteger g)
      THis method will be used only Certificate lab requires that we validate g.
      • Methods inherited from class java.lang.Object

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

      • DSAParameterGenerator

        public DSAParameterGenerator()
        Constructs a new instance of this class.
    • Method Detail

      • engineGenerateParameters

        protected java.security.AlgorithmParameters engineGenerateParameters()
        Answers the newly generated parameters.
        Specified by:
        engineGenerateParameters in class java.security.AlgorithmParameterGeneratorSpi
        Returns:
        AlgorithmParameters the newly generated parameters.
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalGenerateParameters

        protected java.security.AlgorithmParameters internalGenerateParameters()
        Answers the newly generated parameters.
        Returns:
        AlgorithmParameters the newly generated parameters.
      • engineInit

        protected void engineInit(java.security.spec.AlgorithmParameterSpec genParamSpec,
                      java.security.SecureRandom random)
                           throws java.security.InvalidAlgorithmParameterException
        Initializes the receiver with the specified parameters and source of randomness.
        Specified by:
        engineInit in class java.security.AlgorithmParameterGeneratorSpi
        Parameters:
        genParamSpec - AlgorithmParameterSpec parameters for this algorithm
        random - SecureRandom New secure random to use
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
        java.security.InvalidAlgorithmParameterException
      • internalInit

        protected void internalInit(java.security.spec.AlgorithmParameterSpec genParamSpec,
                        java.security.SecureRandom random)
                             throws java.security.InvalidAlgorithmParameterException
        Initializes the receiver with the specified parameters and source of randomness.
        Parameters:
        genParamSpec - AlgorithmParameterSpec parameters for this algorithm
        random - SecureRandom New secure random to use
        Throws:
        java.security.InvalidAlgorithmParameterException
      • engineInit

        protected void engineInit(int size,
                      java.security.SecureRandom random)
        Initializes the receiver with the specified parameter size and source of randomness.
        Specified by:
        engineInit in class java.security.AlgorithmParameterGeneratorSpi
        Parameters:
        size - int Size of the parameters
        random - SecureRandom New secure random to use
        Throws:
        FIPSRuntimeException - if SelfTest.isFipsRunnable returns false.
      • internalInit

        protected void internalInit(int size,
                        java.security.SecureRandom random)
        Initializes the receiver with the specified parameter size and source of randomness.
        Parameters:
        size - int Size of the parameters
        random - SecureRandom New secure random to use
      • generate_g_h

        protected java.math.BigInteger[] generate_g_h(java.math.BigInteger p,
                                          java.math.BigInteger q)
        Generate and return g,h one of the DSA parameters
        Returns:
        BigInteger DSA parameter g and h
      • generateParameters_SP186_4

        protected ProbablePrimeResultFFC generateParameters_SP186_4(int L,
                                                        int N,
                                                        java.security.MessageDigest md,
                                                        byte[] paramSeed)
                                                             throws java.lang.Exception
        Generate parameters for NIST SP186-4 specification
        Parameters:
        L -
        N -
        md -
        paramSeed -
        Throws:
        java.lang.Exception
      • generateParameters_SP186_2

        protected ProbablePrimeResultFFC generateParameters_SP186_2(int L,
                                                        java.security.MessageDigest sha,
                                                        byte[] paramSeed)
                                                             throws java.lang.Exception
        Actual generation of DSA parameters
        Throws:
        java.lang.Exception
      • validate_g

        protected int validate_g(java.math.BigInteger p,
                     java.math.BigInteger q,
                     java.math.BigInteger g)
        THis method will be used only Certificate lab requires that we validate g. There is no complete validation for this class. The best we can do is PARTIALVALID.
        Parameters:
        p -
        q -
        g -
        Returns:
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.