names.put("secp384r1", EllipticCurves.P_384);
names.put("secp521r1", EllipticCurves.P_521);
for (Map.Entry<String,String> e : names.entrySet())
{
ECGenParameterSpec ecGenParameterSpec = new ECGenParameterSpec(e.getKey());
KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC");
kpg.initialize(ecGenParameterSpec);
KeyPair keyPair = kpg.generateKeyPair();
ECPublicKey ecpub = (ECPublicKey) keyPair.getPublic();
ECParameterSpec params = ecpub.getParams();