|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindbright.ssh2.SSH2UserAuth
This class implements the user authentication layer of the secure shell
version 2 (ssh2) protocol stack. It operates on a connected
SSH2Transport
and uses a SSH2Authenticator
which
contains the user's name and a list of one or more authentication methods
(each coupled to a SSH2AuthModule
instance) to try to
authenticate the user.
To create a SSH2UserAuth
instance a connected
SSH2Transport
and a SSH2Authenticator
must be
created first to be passed to the constructor. The constructor is passive in
that it doesn't start any communication. To start the authentication process
the method authenticateUser
must be called. This method blocks
(the authentication process is run in the calling thread) until either the
user is authenticated or authentication fails.
While the authentication process runs events are reported through callbacks
to the SSH2Authenticator
. Each SSH2AuthModule
instance (one active at a time) handles the actual processing and formatting
of the packets specific to the authentication method it represents.
SSH2Transport
,
SSH2Authenticator
,
SSH2AuthModule
Constructor Summary | |
SSH2UserAuth(SSH2Transport transport,
SSH2Authenticator authenticator)
This is the constructor. |
Method Summary | |
boolean |
authenticateUser(java.lang.String service)
Authenticates the user represented by the authenticator to run the given service (currently "ssh-connection" is the only defined service). |
boolean |
authenticateUser(java.lang.String service,
long timeout)
|
SSH2TransportPDU |
createUserAuthRequest(java.lang.String method)
Creates a packet of type USERAUTH_REQUEST (as defined in the userauth protocol spec.). |
SSH2Authenticator |
getAuthenticator()
Gets our authenticator. |
SSH2Transport |
getTransport()
Gets our transport layer. |
boolean |
isAuthenticated()
Checks if the user represented by the SSH2Authenticator we
process has been authenticated yet. |
void |
terminate()
Terminates the authentication process. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SSH2UserAuth(SSH2Transport transport, SSH2Authenticator authenticator)
SSH2Authenticator
which contains the user to authenticate
and provides a list of the authentication methods to try. It is also used
to report authentication events.
transport
- the transport layerauthenticator
- the authenticator containing authentication info for
the user it represents.Method Detail |
public SSH2Transport getTransport()
public SSH2Authenticator getAuthenticator()
public boolean authenticateUser(java.lang.String service)
service
- the service to request
public boolean authenticateUser(java.lang.String service, long timeout)
public SSH2TransportPDU createUserAuthRequest(java.lang.String method)
SSH2AuthModule
implementors to create the
packet to return from the method startAuthentication
.
method
- the name of the authentication method
public void terminate()
public boolean isAuthenticated()
SSH2Authenticator
we
process has been authenticated yet.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |