throw new InvalidKeyException(kaAlgorithm + " key agreement requires "
+ getSimpleName(MQVPublicKey.class) + " for doPhase");
}
MQVPublicKey mqvPubKey = (MQVPublicKey)key;
ECPublicKeyParameters staticKey = (ECPublicKeyParameters)
ECUtil.generatePublicKeyParameter(mqvPubKey.getStaticKey());
ECPublicKeyParameters ephemKey = (ECPublicKeyParameters)
ECUtil.generatePublicKeyParameter(mqvPubKey.getEphemeralKey());
pubKey = new MQVPublicParameters(staticKey, ephemKey);
// TODO Validate that all the keys are using the same parameters?