Here you can find the source of getKeyPairGenerator(final String algorithm)
private static KeyPairGenerator getKeyPairGenerator(final String algorithm) throws NoSuchAlgorithmException
//package com.java2s; //License from project: Apache License import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; public class Main { private static KeyPairGenerator getKeyPairGenerator(final String algorithm) throws NoSuchAlgorithmException { return KeyPairGenerator.getInstance(algorithm); }// w w w . j a v a 2 s.co m private static KeyPairGenerator getKeyPairGenerator(final String algorithm, final int keysize) throws NoSuchAlgorithmException { final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(algorithm); keyPairGenerator.initialize(keysize); return keyPairGenerator; } }