public static KeyPair generateRSAKeyPair() throws GeneralSecurityException {
    KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
    RSAKeyGenParameterSpec keyGenSpec =
      new RSAKeyGenParameterSpec(DEFAULT_RSA_KEY_SIZE_BITS, DEFAULT_RSA_PUB_EXPONENT);
    keyGen.initialize(keyGenSpec, PRNG);
    return keyGen.generateKeyPair();
  }
Generates an RSA key pair with a 2048-bit private key and F4 (65537) as the public exponent.
@return the key pair.
hbase-common/src/test/java/org/apache/hadoop/hbase/io/crypto/tls/X509TestHelpers.java