Package net.schmizz.sshj.userauth.method
Class AuthPublickey
- java.lang.Object
-
- net.schmizz.sshj.userauth.method.AbstractAuthMethod
-
- net.schmizz.sshj.userauth.method.KeyedAuthMethod
-
- net.schmizz.sshj.userauth.method.AuthPublickey
-
- All Implemented Interfaces:
SSHPacketHandler,AuthMethod
public class AuthPublickey extends KeyedAuthMethod
Implements the"publickey"SSH authentication method. Requesting authentication with this method first sends a "feeler" request with just the public key, and if the server responds withSSH_MSG_USERAUTH_PK_OKindicating that the key is acceptable, it proceeds to send a request signed with the private key. Therefore, private keys are not requested from the associatedKeyProviderunless needed.
-
-
Field Summary
-
Fields inherited from class net.schmizz.sshj.userauth.method.KeyedAuthMethod
kProv
-
Fields inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
log, params
-
-
Constructor Summary
Constructors Constructor Description AuthPublickey(KeyProvider kProv)Initialize this method with the provider for public and private key.
-
Method Summary
-
Methods inherited from class net.schmizz.sshj.userauth.method.KeyedAuthMethod
putPubKey, putSig, shouldRetry
-
Methods inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
getName, init, makeAccountResource, request, setLoggerFactory
-
-
-
-
Constructor Detail
-
AuthPublickey
public AuthPublickey(KeyProvider kProv)
Initialize this method with the provider for public and private key.
-
-
Method Detail
-
handle
public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException
Internal use.- Specified by:
handlein interfaceSSHPacketHandler- Overrides:
handlein classAbstractAuthMethod- Parameters:
cmd- the SSHmessage identifierbuf-SSHPacketcontaining rest of the request- Throws:
UserAuthExceptionTransportException
-
buildReq
protected SSHPacket buildReq() throws UserAuthException
Builds a feeler request (sans signature).- Overrides:
buildReqin classAbstractAuthMethod- Throws:
UserAuthException
-
-