throw new IllegalStateException("EC Diffie-Hellman can only be between two parties.");
}
if (!(key instanceof ECPublicKey))
{
throw new InvalidKeyException("EC Key Agreement doPhase requires ECPublicKey");
}
CipherParameters pubKey = ECUtil.generatePublicKeyParameter((PublicKey)key);
result = agreement.calculateAgreement(pubKey);