java - How is composed "public host key and certificates (K_S)" in SSH_MSG_KEX_DH_GEX_REPLY message? (SSH2 key exchange) -


i'm trying implement ssh2 key exchange in java, , having difficulties. rfc4419 states, that:

the server responds with:

 byte    ssh_msg_kex_dh_gex_reply  string  server public host key , certificates (k_s)  mpint   f  string  signature of h 

my question - how "server public host key , certificates (k_s)" should composed? can find information?

i have host public , private key, , can read information needed example:

/*  read required variables public key.  */ dsaparams pubkeydsaparams = ((dsapublickey) pair.getpublic()).getparams(); biginteger p = pubkeydsaparams.getp(); biginteger q = pubkeydsaparams.getq(); biginteger g = pubkeydsaparams.getg();  /* read private exponent private key.  */ dsaprivatekey privkey = (dsaprivatekey) pair.getprivate(); biginteger x = privkey.getx(); 

found answer myself in rfc4253:

signatures encoded follows:

  string    signature format identifier (as specified             public key/certificate format)   byte[n]   signature blob in format specific encoding. 

the "ssh-dss" key format has following specific encoding:

  string    "ssh-dss"   mpint     p   mpint     q   mpint     g   mpint     y 

here, 'p', 'q', 'g', , 'y' parameters form signature key blob.

signature formats:

the following public key and/or certificate formats defined:

   ssh-dss           required     sign   raw dss key    ssh-rsa           recommended  sign   raw rsa key    pgp-sign-rsa      optional     sign   openpgp certificates (rsa key)    pgp-sign-dss      optional     sign   openpgp certificates (dss key) 

Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -