Package org.bouncycastle.crypto.generators

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator


            this.random = random;
        }

        protected AlgorithmParameters engineGenerateParameters()
        {
            DHParametersGenerator        pGen = new DHParametersGenerator();

      if ( random != null )
      {
        pGen.init(strength, 20, random);
      }
      else
      {
        pGen.init(strength, 20, new SecureRandom());
      }

            DHParameters                p = pGen.generateParameters();

            AlgorithmParameters params;

            try
            {
View Full Code Here


        public KeyPair generateKeyPair()
        {
            if (!initialised)
            {
                DHParametersGenerator   pGen = new DHParametersGenerator();

                pGen.init(strength, certainty, random);
                param = new DHKeyGenerationParameters(random, pGen.generateParameters());
                engine.init(param);
                initialised = true;
            }

            AsymmetricCipherKeyPair   pair = engine.generateKeyPair();
View Full Code Here

            this.random = random;
        }

        protected AlgorithmParameters engineGenerateParameters()
        {
            DHParametersGenerator        pGen = new DHParametersGenerator();

            if (random != null)
            {
                pGen.init(strength, 20, random);
            }
            else
            {
                pGen.init(strength, 20, new SecureRandom());
            }

            DHParameters                p = pGen.generateParameters();

            AlgorithmParameters params;

            try
            {
View Full Code Here

     * this test is can take quiet a while
     */
    private TestResult testGeneration(
        int         size)
    {
        DHParametersGenerator       pGen = new DHParametersGenerator();

        pGen.init(size, 10, new SecureRandom());

        DHParameters                dhParams = pGen.generateParameters();

        DHKeyGenerationParameters   params = new DHKeyGenerationParameters(new SecureRandom(), dhParams);

        DHBasicKeyPairGenerator     kpGen = new DHBasicKeyPairGenerator();

View Full Code Here

        public KeyPair generateKeyPair()
        {
            if (!initialised)
            {
                DHParametersGenerator   pGen = new DHParametersGenerator();

                pGen.init(strength, certainty, random);
                param = new DHKeyGenerationParameters(random, pGen.generateParameters());
                engine.init(param);
                initialised = true;
            }

            AsymmetricCipherKeyPair   pair = engine.generateKeyPair();
View Full Code Here

            this.random = random;
        }

        protected AlgorithmParameters engineGenerateParameters()
        {
            DHParametersGenerator        pGen = new DHParametersGenerator();

            if (random != null)
            {
                pGen.init(strength, 20, random);
            }
            else
            {
                pGen.init(strength, 20, new SecureRandom());
            }

            DHParameters                p = pGen.generateParameters();

            AlgorithmParameters params;

            try
            {
View Full Code Here

        public KeyPair generateKeyPair()
        {
            if (!initialised)
            {
                DHParametersGenerator   pGen = new DHParametersGenerator();

                pGen.init(strength, certainty, random);
                param = new DHKeyGenerationParameters(random, pGen.generateParameters());
                engine.init(param);
                initialised = true;
            }

            AsymmetricCipherKeyPair   pair = engine.generateKeyPair();
View Full Code Here

        this.random = random;
    }

    protected AlgorithmParameters engineGenerateParameters()
    {
        DHParametersGenerator pGen = new DHParametersGenerator();

        if (random != null)
        {
            pGen.init(strength, 20, random);
        }
        else
        {
            pGen.init(strength, 20, new SecureRandom());
        }

        DHParameters p = pGen.generateParameters();

        AlgorithmParameters params;

        try
        {
View Full Code Here

                            param = (DHKeyGenerationParameters)params.get(paramStrength);
                        }
                        else
                        {

                            DHParametersGenerator pGen = new DHParametersGenerator();

                            pGen.init(strength, certainty, random);

                            param = new DHKeyGenerationParameters(random, pGen.generateParameters());

                            params.put(paramStrength, param);
                        }
                    }
                }
View Full Code Here

                {
                    param = (DHKeyGenerationParameters)params.get(paramStrength);
                }
                else
                {
                    DHParametersGenerator   pGen = new DHParametersGenerator();

                    pGen.init(strength, certainty, random);

                    param = new DHKeyGenerationParameters(random, pGen.generateParameters());

                    params.put(paramStrength, param);
                }

                engine.init(param);
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.generators.DHParametersGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.