java - apache sshd public key authentication -


i trying set ssh server using apache mina sshd. want use public key authentication, , want know how implement

package org.apache.sshd.server; import java.security.publickey; import org.apache.sshd.server.session.serversession;  public interface publickeyauthenticator {  boolean authenticate(string username, publickey key, serversession session);  } 

i see passed public key. assume supposed compare public key given in param public key server has. don't know how that.

one thing have found this implementation. seems pointless, seems compare modulus of public key itself. assuming implementation has bug, , should comparing moduli of each public key, enough authentication - moduli agree? surely if fed publicly available public key function, authenticated?

i think found answer in source of org.apache.sshd.server.auth.userauthpublickey#auth. class actual auth key. think confused me name of method - authenticate(). happens follows:

  • the server asks public key of client

  • the public key passed publickeyauthenticator#authenticate

  • all supposed in authenticate() check public key want allow

  • if authenticate() returns true, userauthpublickey#auth check message has been signed private key. if has authentication has been validated.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -