Java RSA generateRSAKeyPair()

Here you can find the source of generateRSAKeyPair()

Description

generate RSA Key Pair

License

Apache License

Declaration

private static KeyPair generateRSAKeyPair() 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.security.KeyPair;
import java.security.KeyPairGenerator;

public class Main {
    private static KeyPair generateRSAKeyPair() {
        try {/*ww  w.  j av  a2  s.co  m*/
            KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("RSA");
            keyGenerator.initialize(1024);
            return keyGenerator.genKeyPair();
        } catch (Exception ex) {
            return null;
        }
    }
}

Related

  1. generateKeys()
  2. generateRSA(int keySize)
  3. generateRSAKey(int keySize)
  4. generateRSAKeyPair()
  5. generateRsaKeyPair()
  6. generateRSAKeyPair()
  7. generateRSAKeyPair(final int bits)
  8. generateRSAKeypair(final int keysize, BigInteger publicExponent)