if (!initialised)
{
throw new IllegalStateException("EC Key Pair Generator not initialised");
}
AsymmetricCipherKeyPair pair = engine.generateKeyPair();
ECPublicKeyParameters pub = (ECPublicKeyParameters)pair.getPublic();
ECPrivateKeyParameters priv = (ECPrivateKeyParameters)pair.getPrivate();
return new KeyPair(new JCEECPublicKey(algorithm, pub, ecParams),
new JCEECPrivateKey(algorithm, priv, ecParams));
}