public class PublicKeyAuthenticator extends Object implements ClientAuthenticator, SignatureGenerator
Modifier and Type | Field and Description |
---|---|
static int |
SSH_MSG_USERAUTH_PK_OK |
Constructor and Description |
---|
PublicKeyAuthenticator() |
PublicKeyAuthenticator(SshKeyPair... keys) |
Modifier and Type | Method and Description |
---|---|
void |
authenticate(TransportProtocolClient transport,
String username)
Start the authentication
|
Collection<SshPublicKey> |
getPublicKeys() |
SignatureGenerator |
getSignatureGenerator(Connection<SshClientContext> con) |
protected void |
onStartAuthentication(Connection<SshClientContext> con) |
boolean |
processMessage(ByteArrayReader msg)
Process an authentication message.
|
void |
setKeyPair(SshKeyPair... pair) |
byte[] |
sign(SshPublicKey key,
byte[] data)
Sign the data using the private key of the public key provided.
|
public static final int SSH_MSG_USERAUTH_PK_OK
public PublicKeyAuthenticator()
public PublicKeyAuthenticator(SshKeyPair... keys)
public void setKeyPair(SshKeyPair... pair)
public void authenticate(TransportProtocolClient transport, String username)
ClientAuthenticator
authenticate
in interface ClientAuthenticator
protected void onStartAuthentication(Connection<SshClientContext> con)
public boolean processMessage(ByteArrayReader msg) throws IOException
ClientAuthenticator
processMessage
in interface ClientAuthenticator
IOException
public byte[] sign(SshPublicKey key, byte[] data) throws SshException
SignatureGenerator
sign
in interface SignatureGenerator
SshException
public SignatureGenerator getSignatureGenerator(Connection<SshClientContext> con)
public Collection<SshPublicKey> getPublicKeys()
getPublicKeys
in interface SignatureGenerator
Copyright © 2016. All rights reserved.