org.apache.sshd.agent
Class AgentClient

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.sshd.agent.AgentClient
All Implemented Interfaces:
Runnable, SshAgent

public class AgentClient
extends Thread
implements SshAgent

A client for a remote SSH agent


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Nested classes/interfaces inherited from interface org.apache.sshd.agent.SshAgent
SshAgent.Pair<U,V>
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface org.apache.sshd.agent.SshAgent
SSH_AUTHSOCKET_ENV_NAME
 
Constructor Summary
AgentClient(String authSocket)
           
 
Method Summary
 void addIdentity(KeyPair key, String comment)
           
 void close()
           
protected  Buffer createBuffer(byte cmd)
           
 List<SshAgent.Pair<PublicKey,String>> getIdentities()
           
protected  void messageReceived(Buffer buffer)
           
 void removeAllIdentities()
           
 void removeIdentity(PublicKey key)
           
protected  Buffer request(Buffer buffer)
           
 void run()
           
 byte[] sign(PublicKey key, byte[] data)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentClient

public AgentClient(String authSocket)
            throws IOException
Throws:
IOException
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

messageReceived

protected void messageReceived(Buffer buffer)
                        throws Exception
Throws:
Exception

getIdentities

public List<SshAgent.Pair<PublicKey,String>> getIdentities()
                                                    throws IOException
Specified by:
getIdentities in interface SshAgent
Throws:
IOException

sign

public byte[] sign(PublicKey key,
                   byte[] data)
            throws IOException
Specified by:
sign in interface SshAgent
Throws:
IOException

addIdentity

public void addIdentity(KeyPair key,
                        String comment)
                 throws IOException
Specified by:
addIdentity in interface SshAgent
Throws:
IOException

removeIdentity

public void removeIdentity(PublicKey key)
                    throws IOException
Specified by:
removeIdentity in interface SshAgent
Throws:
IOException

removeAllIdentities

public void removeAllIdentities()
                         throws IOException
Specified by:
removeAllIdentities in interface SshAgent
Throws:
IOException

close

public void close()
Specified by:
close in interface SshAgent

createBuffer

protected Buffer createBuffer(byte cmd)

request

protected Buffer request(Buffer buffer)
                  throws IOException
Throws:
IOException


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.