Here you can find the source of generateKeyPair(String algo)
public static KeyPair generateKeyPair(String algo) throws GeneralSecurityException
//package com.java2s; //License from project: Open Source License import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; public class Main { public static KeyPair generateKeyPair(String algo) throws GeneralSecurityException { KeyPairGenerator kpg = KeyPairGenerator.getInstance(algo); return kpg.genKeyPair(); }/*from ww w . jav a 2s . c om*/ }