Package org.apache.sshd.agent.common
Class AbstractAgentProxy
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.agent.common.AbstractAgentProxy
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.nio.channels.Channel
,SshAgent
,ExecutorServiceCarrier
public abstract class AbstractAgentProxy extends AbstractLoggingBean implements SshAgent, ExecutorServiceCarrier
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
channelType
private CloseableExecutorService
executor
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.agent.SshAgent
SSH_AUTHSOCKET_ENV_NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAgentProxy(CloseableExecutorService executorService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addIdentity(java.security.KeyPair kp, java.lang.String comment)
void
close()
protected Buffer
createBuffer(byte cmd)
protected Buffer
createBuffer(byte cmd, int extraLen)
java.lang.String
getChannelType()
CloseableExecutorService
getExecutorService()
java.lang.Iterable<? extends java.util.Map.Entry<java.security.PublicKey,java.lang.String>>
getIdentities()
protected Buffer
prepare(Buffer buffer)
void
removeAllIdentities()
void
removeIdentity(java.security.PublicKey key)
protected abstract Buffer
request(Buffer buffer)
void
setChannelType(java.lang.String channelType)
byte[]
sign(SessionContext session, java.security.PublicKey key, byte[] data)
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
getSimplifiedLogger
-
-
-
-
Field Detail
-
executor
private CloseableExecutorService executor
-
channelType
private java.lang.String channelType
-
-
Constructor Detail
-
AbstractAgentProxy
protected AbstractAgentProxy(CloseableExecutorService executorService)
-
-
Method Detail
-
getChannelType
public java.lang.String getChannelType()
-
setChannelType
public void setChannelType(java.lang.String channelType)
-
getExecutorService
public CloseableExecutorService getExecutorService()
- Specified by:
getExecutorService
in interfaceExecutorServiceCarrier
- Returns:
- The
CloseableExecutorService
to use
-
getIdentities
public java.lang.Iterable<? extends java.util.Map.Entry<java.security.PublicKey,java.lang.String>> getIdentities() throws java.io.IOException
- Specified by:
getIdentities
in interfaceSshAgent
- Throws:
java.io.IOException
-
sign
public byte[] sign(SessionContext session, java.security.PublicKey key, byte[] data) throws java.io.IOException
-
addIdentity
public void addIdentity(java.security.KeyPair kp, java.lang.String comment) throws java.io.IOException
- Specified by:
addIdentity
in interfaceSshAgent
- Throws:
java.io.IOException
-
removeIdentity
public void removeIdentity(java.security.PublicKey key) throws java.io.IOException
- Specified by:
removeIdentity
in interfaceSshAgent
- Throws:
java.io.IOException
-
removeAllIdentities
public void removeAllIdentities() throws java.io.IOException
- Specified by:
removeAllIdentities
in interfaceSshAgent
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.nio.channels.Channel
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
createBuffer
protected Buffer createBuffer(byte cmd)
-
createBuffer
protected Buffer createBuffer(byte cmd, int extraLen)
-
-