{
throw new InvalidKeyException(kaAlgorithm + " key agreement requires "
+ getSimpleName(MQVPrivateKey.class) + " for initialisation");
}
MQVPrivateKey mqvPrivKey = (MQVPrivateKey)key;
ECPrivateKeyParameters staticPrivKey = (ECPrivateKeyParameters)
ECUtil.generatePrivateKeyParameter(mqvPrivKey.getStaticPrivateKey());
ECPrivateKeyParameters ephemPrivKey = (ECPrivateKeyParameters)
ECUtil.generatePrivateKeyParameter(mqvPrivKey.getEphemeralPrivateKey());
ECPublicKeyParameters ephemPubKey = null;
if (mqvPrivKey.getEphemeralPublicKey() != null)
{
ephemPubKey = (ECPublicKeyParameters)
ECUtil.generatePublicKeyParameter(mqvPrivKey.getEphemeralPublicKey());
}
MQVPrivateParameters localParams = new MQVPrivateParameters(staticPrivKey, ephemPrivKey, ephemPubKey);
this.parameters = staticPrivKey.getParameters();