|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sshtools.j2ssh.agent.SshAgentConnection
public class SshAgentConnection
This class provides a connection using the SSH agent protocol.
| Field Summary | |
|---|---|
(package private) java.util.Vector |
forwardingNodes
|
(package private) java.io.InputStream |
in
|
(package private) KeyStore |
keystore
|
private static org.apache.commons.logging.Log |
log
|
(package private) java.io.OutputStream |
out
|
(package private) java.net.Socket |
socket
|
(package private) java.lang.Thread |
thread
|
| Constructor Summary | |
|---|---|
SshAgentConnection(KeyStore keystore,
java.io.InputStream in,
java.io.OutputStream out)
|
|
SshAgentConnection(KeyStore keystore,
java.net.Socket socket)
|
|
| Method Summary | |
|---|---|
protected void |
onAddKey(SshAgentAddKey msg)
Called when the remote side adds a key the agent. |
protected void |
onDeleteAllKeys(SshAgentDeleteAllKeys 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 |
onForwardingNotice(SshAgentForwardingNotice msg)
Called when a forwarding notice is recceived from the remote side. |
protected void |
onListKeys(SshAgentListKeys 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 |
onPing(SshAgentPing msg)
Called when a ping message is received |
protected void |
onPrivateKeyOp(SshAgentPrivateKeyOp msg)
Called by the remote side to initiate a private key operation. |
protected void |
onRandom(SshAgentRandom msg)
Called when the remote side sends a random message |
protected void |
onRequestVersion(SshAgentRequestVersion msg)
Called when the remote side requests the version number of this protocol. |
protected void |
onUnlock(SshAgentUnlock msg)
Called by the remote side when the agent is to be unlocked |
void |
run()
The connection thread |
protected void |
sendAgentAlive(byte[] padding)
Send the agent alive message. |
protected void |
sendAgentFailure(int errorcode)
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(SubsystemMessage msg)
Sends a subsystem message. |
protected void |
sendOperationComplete(byte[] data)
Send the completed signing operation data. |
protected void |
sendRandomData(byte[] data)
Send some random data to the remote side. |
protected void |
sendVersionResponse()
Send the version response; this class currently implements version 2 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static org.apache.commons.logging.Log log
java.io.InputStream in
java.io.OutputStream out
KeyStore keystore
java.lang.Thread thread
java.util.Vector forwardingNodes
java.net.Socket socket
| Constructor Detail |
|---|
SshAgentConnection(KeyStore keystore,
java.io.InputStream in,
java.io.OutputStream out)
SshAgentConnection(KeyStore keystore,
java.net.Socket socket)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
protected void sendAgentSuccess()
throws java.io.IOException
java.io.IOException - if an IO error occurs
protected void sendAgentFailure(int errorcode)
throws java.io.IOException
errorcode - the error code of the failure
java.io.IOException - if an IO error occurs
protected void sendVersionResponse()
throws java.io.IOException
java.io.IOException - if an IO error occurs
protected void sendAgentKeyList()
throws java.io.IOException
java.io.IOException - if an IO error occurs
protected void sendOperationComplete(byte[] data)
throws java.io.IOException
data - the data generating from the signing operation
java.io.IOException - if an IO error occurs
protected void sendRandomData(byte[] data)
throws java.io.IOException
data - some random data
java.io.IOException - if an IO error occurs
protected void sendAgentAlive(byte[] padding)
throws java.io.IOException
padding - some random padding for the message
java.io.IOException - if an IO error occurs
protected void sendMessage(SubsystemMessage msg)
throws java.io.IOException
msg - the subsystem message to send
java.io.IOException - if an IO error occursprotected void onForwardingNotice(SshAgentForwardingNotice msg)
msg - the forwarding notice
protected void onRequestVersion(SshAgentRequestVersion msg)
throws java.io.IOException
msg - the version request message
java.io.IOException - if an IO error occurs
protected void onAddKey(SshAgentAddKey msg)
throws java.io.IOException
msg - the message containing the key
java.io.IOException - if an IO error occurs
protected void onDeleteAllKeys(SshAgentDeleteAllKeys msg)
throws java.io.IOException
msg - the delete all keys message
java.io.IOException - if an IO error occurs
protected void onListKeys(SshAgentListKeys msg)
throws java.io.IOException
msg - the list all keys message
java.io.IOException - if an IO error occurs
protected void onPrivateKeyOp(SshAgentPrivateKeyOp msg)
throws java.io.IOException
msg - the private key operation message
java.io.IOException - if an IO error occurs
protected void onDeleteKey(SshAgentDeleteKey msg)
throws java.io.IOException
msg - the message containin the key to delete
java.io.IOException - if an IO error occurs
protected void onLock(SshAgentLock msg)
throws java.io.IOException
msg - the message containing a password
java.io.IOException - if an IO error occurs
protected void onUnlock(SshAgentUnlock msg)
throws java.io.IOException
msg - the message containin the password
java.io.IOException - if an IO error occurs
protected void onPing(SshAgentPing msg)
throws java.io.IOException
msg - the ping message containing some padding
java.io.IOException - if an IO error occurs
protected void onRandom(SshAgentRandom msg)
throws java.io.IOException
msg - the random message
java.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 received
java.io.IOException - if an IO error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||