Class AbstractAgentProxy

java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.agent.common.AbstractAgentProxy
All Implemented Interfaces:
Closeable, AutoCloseable, Channel, SshAgent, org.apache.sshd.common.util.threads.ExecutorServiceCarrier
Direct Known Subclasses:
AgentClient

public abstract class AbstractAgentProxy extends org.apache.sshd.common.util.logging.AbstractLoggingBean implements SshAgent, org.apache.sshd.common.util.threads.ExecutorServiceCarrier
Author:
Apache MINA SSHD Project
  • Constructor Details

    • AbstractAgentProxy

      protected AbstractAgentProxy(org.apache.sshd.common.util.threads.CloseableExecutorService executorService)
  • Method Details

    • getChannelType

      public String getChannelType()
    • setChannelType

      public void setChannelType(String channelType)
    • getExecutorService

      public org.apache.sshd.common.util.threads.CloseableExecutorService getExecutorService()
      Specified by:
      getExecutorService in interface org.apache.sshd.common.util.threads.ExecutorServiceCarrier
    • getIdentities

      public Iterable<? extends Map.Entry<PublicKey, String>> getIdentities() throws IOException
      Specified by:
      getIdentities in interface SshAgent
      Throws:
      IOException
    • sign

      public Map.Entry<String,byte[]> sign(org.apache.sshd.common.session.SessionContext session, PublicKey key, String algo, byte[] data) throws IOException
      Specified by:
      sign in interface SshAgent
      Parameters:
      session - The current SessionContext
      key - The PublicKey to use for signing
      algo - Recommended signature algorithm - if null/empty then one will be selected based on the key type and/or signature factories. Note: even if specific algorithm specified, the implementation may disregard and choose another
      data - Data to sign
      Returns:
      used algorithm + signed data - using the identity
      Throws:
      IOException - If failed to sign
    • addIdentity

      public void addIdentity(KeyPair kp, String comment, SshAgentKeyConstraint... constraints) throws IOException
      Description copied from interface: SshAgent
      Adds a key to the agent.
      Specified by:
      addIdentity in interface SshAgent
      Parameters:
      kp - KeyPair to add
      comment - to associate with the key
      constraints - SshAgentKeyConstraints for this key to pass on to the agent
      Throws:
      IOException - if an error in the communication with the agent occurred, or the agent did not return a reply indicating successful addition of the key
    • 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() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Channel
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • createBuffer

      protected org.apache.sshd.common.util.buffer.Buffer createBuffer(byte cmd)
    • createBuffer

      protected org.apache.sshd.common.util.buffer.Buffer createBuffer(byte cmd, int extraLen)
    • prepare

      protected org.apache.sshd.common.util.buffer.Buffer prepare(org.apache.sshd.common.util.buffer.Buffer buffer)
    • request

      protected abstract org.apache.sshd.common.util.buffer.Buffer request(org.apache.sshd.common.util.buffer.Buffer buffer) throws IOException
      Throws:
      IOException