public class OpenSSHAgentConnection extends java.lang.Object implements java.lang.Runnable, SshAgentConnection
Constructor and Description |
---|
OpenSSHAgentConnection(KeyStore keystore,
java.io.InputStream in,
java.io.OutputStream out,
java.io.Closeable closeable) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
encodeSignature(com.sshtools.common.ssh.components.SshPublicKey key,
int flags,
byte[] signature) |
protected void |
onAddKey(SshAgentAddKey msg)
Called when the remote side adds a key the agent.
|
protected void |
onDeleteAllKeys(AgentMessage msg)
Called when the remote side requests that all keys be removed from the
agent.
|
protected void |
onDeleteKey(SshAgentDeleteKey msg)
Called by the remote side to delete a key from the agent
|
protected void |
onListKeys(AgentMessage msg)
Called by the remote side when a list of the agents keys is required
|
protected void |
onLock(SshAgentLock msg)
Called by the remote side when the agent is to be locked
|
protected void |
onMessageReceived(byte[] msgdata)
Process a message and route to the handler method
|
protected void |
onPrivateKeyOp(SshAgentPrivateKeyOp msg)
Called by the remote side to initiate a private key operation.
|
protected void |
onUnlock(SshAgentUnlock msg)
Called by the remote side when the agent is to be unlocked
|
void |
run()
The connection thread
|
protected void |
sendAgentFailure()
Send a failure message
|
protected void |
sendAgentKeyList()
Send the agents key list to the remote side.
|
protected void |
sendAgentSuccess()
Send a success message.
|
protected void |
sendMessage(AgentMessage msg)
Sends a subsystem message.
|
protected void |
sendOperationComplete(byte[] data)
Send the completed signing operation data.
|
public OpenSSHAgentConnection(KeyStore keystore, java.io.InputStream in, java.io.OutputStream out, java.io.Closeable closeable)
protected void sendAgentSuccess() throws java.io.IOException
java.io.IOException
- if an IO error occursprotected void sendAgentFailure() throws java.io.IOException
errorcode
- the error code of the failurejava.io.IOException
- if an IO error occursprotected void sendAgentKeyList() throws java.io.IOException
java.io.IOException
- if an IO error occursprotected void sendOperationComplete(byte[] data) throws java.io.IOException
data
- the data generating from the signing operationjava.io.IOException
- if an IO error occursprotected void sendMessage(AgentMessage msg) throws java.io.IOException
msg
- the subsystem message to sendjava.io.IOException
- if an IO error occursprotected void onAddKey(SshAgentAddKey msg) throws java.io.IOException
msg
- the message containing the keyjava.io.IOException
- if an IO error occursprotected void onDeleteAllKeys(AgentMessage msg) throws java.io.IOException
msg
- the delete all keys messagejava.io.IOException
- if an IO error occursprotected void onListKeys(AgentMessage msg) throws java.io.IOException
msg
- the list all keys messagejava.io.IOException
- if an IO error occursprotected void onPrivateKeyOp(SshAgentPrivateKeyOp msg) throws java.io.IOException
msg
- the private key operation messagejava.io.IOException
- if an IO error occursprotected byte[] encodeSignature(com.sshtools.common.ssh.components.SshPublicKey key, int flags, byte[] signature) throws java.io.IOException
java.io.IOException
protected void onDeleteKey(SshAgentDeleteKey msg) throws java.io.IOException
msg
- the message containin the key to deletejava.io.IOException
- if an IO error occursprotected void onLock(SshAgentLock msg) throws java.io.IOException
msg
- the message containing a passwordjava.io.IOException
- if an IO error occursprotected void onUnlock(SshAgentUnlock msg) throws java.io.IOException
msg
- the message containin the passwordjava.io.IOException
- if an IO error occurspublic void run()
run
in interface java.lang.Runnable
protected void onMessageReceived(byte[] msgdata) throws java.io.IOException
msgdata
- the raw message receivedjava.io.IOException
- if an IO error occursCopyright © 2024. All rights reserved.