Here you can find the source of generateKeyPair()
public static KeyPair generateKeyPair() throws NoSuchAlgorithmException
//package com.java2s; //License from project: Open Source License import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; public class Main { public static KeyPair generateKeyPair() throws NoSuchAlgorithmException { final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC"); final SecureRandom random = SecureRandom.getInstance("SHA1PRNG"); keyPairGenerator.initialize(256, random); final KeyPair keyPair = keyPairGenerator.generateKeyPair(); return keyPair; }/*www . j a va2s . com*/ }