Examples of generateParameters()


Examples of java.security.AlgorithmParameterGenerator.generateParameters()

        int         size)
        throws Exception
    {
        AlgorithmParameterGenerator a = AlgorithmParameterGenerator.getInstance("ElGamal", "BC");
        a.init(size, new SecureRandom());
        AlgorithmParameters params = a.generateParameters();

        byte[] encodeParams = params.getEncoded();

        AlgorithmParameters a2 = AlgorithmParameters.getInstance("ElGamal", "BC");
        a2.init(encodeParams);
View Full Code Here

Examples of java.security.AlgorithmParameterGenerator.generateParameters()

    {
        try
        {
            AlgorithmParameterGenerator a = AlgorithmParameterGenerator.getInstance("DH", "BC");
            a.init(size, new SecureRandom());
            AlgorithmParameters params = a.generateParameters();

            byte[] encodeParams = params.getEncoded();

            AlgorithmParameters a2 = AlgorithmParameters.getInstance("DH", "BC");
            a2.init(encodeParams);
View Full Code Here

Examples of java.security.AlgorithmParameterGenerator.generateParameters()

    {

        String s = "1.2.840.113549.3.2";

        AlgorithmParameterGenerator algorithmparametergenerator = AlgorithmParameterGenerator.getInstance(s);
        AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters();
        ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1"));
        ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream);
        DERObject derobject = asn1inputstream.readObject();
        KeyGenerator keygenerator = KeyGenerator.getInstance(s);
        keygenerator.init(128);
View Full Code Here

Examples of java.security.AlgorithmParameterGenerator.generateParameters()

    AlgorithmParameterGenerator gen = AlgorithmParameterGenerator
        .getInstance("DSA");
    gen.init(1024);

    // WARNING - The next line can take MINUTES to run
    AlgorithmParameters params = gen.generateParameters();
    assertNotNull("params is null", params);
  }

  /**
   * @tests java.security.AlgorithmParameterGenerator#getAlgorithm()
View Full Code Here

Examples of java.security.AlgorithmParameterGenerator.generateParameters()

    {

        String s = "1.2.840.113549.3.2";

        AlgorithmParameterGenerator algorithmparametergenerator = AlgorithmParameterGenerator.getInstance(s);
        AlgorithmParameters algorithmparameters = algorithmparametergenerator.generateParameters();
        ByteArrayInputStream bytearrayinputstream = new ByteArrayInputStream(algorithmparameters.getEncoded("ASN.1"));
        ASN1InputStream asn1inputstream = new ASN1InputStream(bytearrayinputstream);
        ASN1Primitive derobject = asn1inputstream.readObject();
        KeyGenerator keygenerator = KeyGenerator.getInstance(s);
        keygenerator.init(128);
View Full Code Here

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator.generateParameters()

      else
      {
        pGen.init(strength, 20, new SecureRandom());
      }

            DHParameters                p = pGen.generateParameters();

            AlgorithmParameters params;

            try
            {
View Full Code Here

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator.generateParameters()

            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

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator.generateParameters()

            else
            {
                pGen.init(strength, 20, new SecureRandom());
            }

            DHParameters                p = pGen.generateParameters();

            AlgorithmParameters params;

            try
            {
View Full Code Here

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator.generateParameters()

    {
        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

Examples of org.bouncycastle.crypto.generators.DHParametersGenerator.generateParameters()

            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
TOP
Copyright © 2018 www.massapi.com. 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.