I'm trying to implement SSH2 key exchange in Java, and having some difficulties. The RFC4419 states, that:
The server responds with:
byte SSH_MSG_KEX_DH_GEX_REPLY string server public host key and certificates (K_S) mpint f string signature of H
My question is - how the "server public host key and certificates (K_S)" should be composed? Where can I find this information?
I have host public and private key, and can read all information needed like for example:
/* Read the required variables from the public key. */ DSAParams pubKeyDSAParams = ((DSAPublicKey) pair.getPublic()).getParams(); BigInteger p = pubKeyDSAParams.getP(); BigInteger q = pubKeyDSAParams.getQ(); BigInteger g = pubKeyDSAParams.getG(); /* Read the private exponent from the private key. */ DSAPrivateKey privKey = (DSAPrivateKey) pair.getPrivate(); BigInteger x = privKey.getX();