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.
Requesteing authentication with this method first sends a "feeler" request with just the public key, and if the
server responds with SSH_MSG_USERAUTH_PK_OK
indicating that the key is acceptable, it proceeds to send a
request signed with the private key. Therefore, private keys are not requested from the associated KeyProvider
unless needed.
Constructor Summary |
AuthPublickey(KeyProvider kProv)
Initialize this method with the provider for public and private key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AuthPublickey
public AuthPublickey(KeyProvider kProv)
- Initialize this method with the provider for public and private key.
handle
public void handle(Message cmd,
SSHPacket buf)
throws UserAuthException,
TransportException
- Internal use.
- Specified by:
handle
in interface SSHPacketHandler
- Overrides:
handle
in class AbstractAuthMethod
- Parameters:
cmd
- the SSH message identifier
buf
- SSHPacket
containing rest of the request
- Throws:
UserAuthException
TransportException
buildReq
protected SSHPacket buildReq()
throws UserAuthException
- Builds a feeler request (sans signature).
- Overrides:
buildReq
in class AbstractAuthMethod
- Throws:
UserAuthException
Copyright © 2009-2012. All Rights Reserved.