public class TrileadSSHPublicKeyAuthenticator extends SSHAuthenticator<com.trilead.ssh2.Connection,SSHUserPrivateKey>
Connection
.Modifier and Type | Class and Description |
---|---|
static class |
TrileadSSHPublicKeyAuthenticator.Factory
Extension point to allow plugging in
SSHAuthenticator implementations for the many SSH client libraries
available. |
SSHAuthenticator.Mode
Constructor and Description |
---|
TrileadSSHPublicKeyAuthenticator(com.trilead.ssh2.Connection connection,
SSHUserPrivateKey user)
Constructor.
|
TrileadSSHPublicKeyAuthenticator(com.trilead.ssh2.Connection connection,
SSHUserPrivateKey user,
String username)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canAuthenticate()
Returns
true if the bound connection is in a state where authentication can be tried using the
supplied credentials. |
protected boolean |
doAuthenticate()
SPI for authenticating the bound connection using the supplied credentials.
|
authenticate, authenticate, filter, getAuthenticationMode, getConnection, getListener, getPrivateKeys, getUser, getUsername, isAuthenticated, isSupported, matcher, matcher, newInstance, newInstance, newInstance, setListener
public TrileadSSHPublicKeyAuthenticator(com.trilead.ssh2.Connection connection, SSHUserPrivateKey user)
connection
- the connection we will be authenticating.public TrileadSSHPublicKeyAuthenticator(@NonNull com.trilead.ssh2.Connection connection, @NonNull SSHUserPrivateKey user, @CheckForNull String username)
connection
- the connection we will be authenticating.public boolean canAuthenticate()
true
if the bound connection is in a state where authentication can be tried using the
supplied credentials.
Subclasses can override this if they can tell whether it is possible to make an authentication attempt, default
implementation is one-shot always.canAuthenticate
in class SSHAuthenticator<com.trilead.ssh2.Connection,SSHUserPrivateKey>
true
if the bound connection is in a state where authentication can be tried using the
supplied credentials.protected boolean doAuthenticate()
SSHAuthenticator.getListener()
before this method returns with false
. This helps an user better understand
what is tried and failing. Logging can be used in addition to this to capture further details.
(in contrast, please avoid reporting a success to the listener to improve S/N ratio)doAuthenticate
in class SSHAuthenticator<com.trilead.ssh2.Connection,SSHUserPrivateKey>
true
if and only if authentication was successful.Copyright © 2014. All rights reserved.