public class OpenSSHAgentConnection extends Object implements Runnable, SshAgentConnection
Constructor and Description |
---|
OpenSSHAgentConnection(KeyStore keystore,
InputStream in,
OutputStream out,
Closeable closeable) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
encodeSignature(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, InputStream in, OutputStream out, Closeable closeable)
protected void sendAgentSuccess() throws IOException
IOException
- if an IO error occursprotected void sendAgentFailure() throws IOException
errorcode
- the error code of the failureIOException
- if an IO error occursprotected void sendAgentKeyList() throws IOException
IOException
- if an IO error occursprotected void sendOperationComplete(byte[] data) throws IOException
data
- the data generating from the signing operationIOException
- if an IO error occursprotected void sendMessage(AgentMessage msg) throws IOException
msg
- the subsystem message to sendIOException
- if an IO error occursprotected void onAddKey(SshAgentAddKey msg) throws IOException
msg
- the message containing the keyIOException
- if an IO error occursprotected void onDeleteAllKeys(AgentMessage msg) throws IOException
msg
- the delete all keys messageIOException
- if an IO error occursprotected void onListKeys(AgentMessage msg) throws IOException
msg
- the list all keys messageIOException
- if an IO error occursprotected void onPrivateKeyOp(SshAgentPrivateKeyOp msg) throws IOException
msg
- the private key operation messageIOException
- if an IO error occursprotected byte[] encodeSignature(SshPublicKey key, int flags, byte[] signature) throws IOException
IOException
protected void onDeleteKey(SshAgentDeleteKey msg) throws IOException
msg
- the message containin the key to deleteIOException
- if an IO error occursprotected void onLock(SshAgentLock msg) throws IOException
msg
- the message containing a passwordIOException
- if an IO error occursprotected void onUnlock(SshAgentUnlock msg) throws IOException
msg
- the message containin the passwordIOException
- if an IO error occursprotected void onMessageReceived(byte[] msgdata) throws IOException
msgdata
- the raw message receivedIOException
- if an IO error occursCopyright © 2024. All rights reserved.