Package org.bouncycastle.jce.provider

Examples of org.bouncycastle.jce.provider.JDKKeyPairGenerator


    int strength = keyLength.value();
    BigInteger publicExp = new BigInteger("10001", 16); // Fermat F4, largest known fermat prime

    try {
      JDKKeyPairGenerator gen = new JDKKeyPairGenerator.RSA();
      RSAKeyGenParameterSpec params = new RSAKeyGenParameterSpec(strength, publicExp);
      gen.initialize(params, new SecureRandom());
      return gen.generateKeyPair();
    } catch (InvalidAlgorithmParameterException e) {
      logger.error("Exception whil RSA key pair generation:", e);
    }
    return null;
View Full Code Here

TOP

Related Classes of org.bouncycastle.jce.provider.JDKKeyPairGenerator

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.