code: protected static KeyPair generateKeyPair(String jcaAlgorithmName, int keySizeInBits, SecureRandom random) {
          KeyPairGenerator keyGenerator;
          try {
              keyGenerator = KeyPairGenerator.getInstance(jcaAlgorithmName);
          } catch (NoSuchAlgorithmException e) {
              throw new IllegalStateException("Unable to obtain an RSA KeyPairGenerator: " + e.getMessage(), e);
          }
  
          keyGenerator.initialize(keySizeInBits, random);
  
          return keyGenerator.genKeyPair();
      }
docs: Generates a new secure-random key pair of the specified size using the specified SecureRandom according to the
  specified {@code jcaAlgorithmName}.
  
  @param jcaAlgorithmName the name of the JCA algorithm to use for key pair generation, for example, {@code RSA}.
  @param keySizeInBits    the key size in bits (<em>NOT bytes</em>)
  @param random           the SecureRandom generator to use during key generation.
  @return a new secure-randomly generated key pair of the specified size using the specified SecureRandom according
  to the specified {@code jcaAlgorithmName}.
  @see #generateKeyPair()
  @see #generateKeyPair(int)
  @see #generateKeyPair(int, SecureRandom)
  @since 0.5