Here you can find the source of getKeyPair()
public static KeyPair getKeyPair()
//package com.java2s; import java.security.KeyPair; import java.security.KeyPairGenerator; public class Main { private static KeyPairGenerator kpg; /**// w w w. ja v a2 s . c o m * The method gets the key pair. * @return a pair of keys */ public static KeyPair getKeyPair() { return kpg.genKeyPair(); } }