Package com.sshtools.client
Class PublicKeyAuthenticator
java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.client.SimpleClientAuthenticator
com.sshtools.client.PublicKeyAuthenticator
- All Implemented Interfaces:
ClientAuthenticator,RequestFuture
- Direct Known Subclasses:
ExternalKeyAuthenticator,IdentityFileAuthenticator,KeyPairAuthenticator,PrivateKeyFileAuthenticator
public abstract class PublicKeyAuthenticator
extends SimpleClientAuthenticator
implements ClientAuthenticator
Implements public key authentication taking a separately loaded SshKeyPair as the private key for authentication.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(TransportProtocolClient transport, String username) Start the authenticationprotected abstract SshKeyPairgetName()The authentication mechanism name/.protected abstract SshPublicKeyprotected SignatureGeneratorprotected abstract booleanprotected voidbooleanprocessMessage(com.sshtools.common.util.ByteArrayReader msg) Process an authentication message.byte[]sign(SshPrivateKey prv, String signingAlgorithm, byte[] data) Methods inherited from class com.sshtools.client.SimpleClientAuthenticator
cancel, failure, getAuthenticationMethods, isCancelled, isMoreAuthenticationRequired, success, successMethods inherited from class com.sshtools.common.ssh.AbstractRequestFuture
addFutureListener, done, isDone, isSuccess, waitFor, waitForeverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sshtools.client.ClientAuthenticator
cancel, failure, getAuthenticationMethods, isCancelled, isMoreAuthenticationRequired, success, successMethods inherited from interface com.sshtools.common.ssh.RequestFuture
addFutureListener, isDone, isDoneAndSuccess, isSuccess, waitFor, waitForever
-
Field Details
-
SSH_MSG_USERAUTH_PK_OK
public static final int SSH_MSG_USERAUTH_PK_OK- See Also:
-
-
Constructor Details
-
PublicKeyAuthenticator
public PublicKeyAuthenticator()
-
-
Method Details
-
authenticate
public void authenticate(TransportProtocolClient transport, String username) throws IOException, SshException Description copied from interface:ClientAuthenticatorStart the authentication- Specified by:
authenticatein interfaceClientAuthenticator- Throws:
IOExceptionSshException
-
onStartAuthentication
-
getNextKey
- Throws:
IOException
-
getAuthenticatingKey
-
hasCredentialsRemaining
protected abstract boolean hasCredentialsRemaining() -
getSignatureGenerator
-
processMessage
public boolean processMessage(com.sshtools.common.util.ByteArrayReader msg) throws IOException, SshException Description copied from interface:ClientAuthenticatorProcess an authentication message.- Specified by:
processMessagein interfaceClientAuthenticator- Overrides:
processMessagein classSimpleClientAuthenticator- Returns:
- Throws:
IOExceptionSshException
-
sign
- Throws:
SshException
-
getName
Description copied from interface:ClientAuthenticatorThe authentication mechanism name/.- Specified by:
getNamein interfaceClientAuthenticator- Returns:
-