Code example for KeyPair

0
                return new KeyPair(pubKey,
                                   new JCEECPrivateKey(algorithm, priv, pubKey, p));
            } 
            else if (ecParams == null)
            { 
               return new KeyPair(new JCEECPublicKey(algorithm, pub),
                                   new JCEECPrivateKey(algorithm, priv));
            } 
            else 
            { 
                java.security.spec.ECParameterSpec p = (java.security.spec.ECParameterSpec)ecParams;
 
                JCEECPublicKey pubKey = new JCEECPublicKey(algorithm, pub, p);
                 
                return new KeyPair(pubKey, new JCEECPrivateKey(algorithm, priv, pubKey, p));
            } 
        } 
    } 
 
    public static class ECDSA 
        extends EC