internalError();
RuntimeException re = new RuntimeException (kae.getMessage());
re.initCause (kae);
throw re;
}
GnuDHPublicKey pubkey =
new GnuDHPublicKey(null, servParams.getParams().getP(),
servParams.getParams().getG(), serv_y);
Signature s = null;
if (suite.getSignature() != "anon")
{
ISignature sig = null;
if (suite.getSignature() == "RSA")
{
sig = new SSLRSASignature();
}
else
{
sig = SignatureFactory.getInstance(Registry.DSS_SIG);
}
sig.setupSign(Collections.singletonMap(ISignature.SIGNER_KEY,
signPair.getPrivate()));
byte[] buf = clientRandom.getEncoded();
sig.update(buf, 0, buf.length);
buf = serverRandom.getEncoded();
sig.update(buf, 0, buf.length);
updateSig(sig, pubkey.getParams().getP());
updateSig(sig, pubkey.getParams().getG());
updateSig(sig, pubkey.getY());
s = new Signature(sig.sign(), suite.getSignature());
}
skex = new ServerKeyExchange(pubkey, s);
}
else if (suite.getKeyExchange() == "SRP")