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
-
Field Summary
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields inherited from interface SshAgent
SSH_AUTHSOCKET_ENV_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractAgentProxy(org.apache.sshd.common.util.threads.CloseableExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentity(KeyPair kp, String comment, SshAgentKeyConstraint... constraints) Adds a key to the agent.voidclose()protected org.apache.sshd.common.util.buffer.BuffercreateBuffer(byte cmd) protected org.apache.sshd.common.util.buffer.BuffercreateBuffer(byte cmd, int extraLen) org.apache.sshd.common.util.threads.CloseableExecutorServiceprotected org.apache.sshd.common.util.buffer.Bufferprepare(org.apache.sshd.common.util.buffer.Buffer buffer) voidvoidremoveIdentity(PublicKey key) protected abstract org.apache.sshd.common.util.buffer.Bufferrequest(org.apache.sshd.common.util.buffer.Buffer buffer) voidsetChannelType(String channelType) sign(org.apache.sshd.common.session.SessionContext session, PublicKey key, String algo, byte[] data) Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SshAgent
resolveLocalIdentity
-
Constructor Details
-
AbstractAgentProxy
protected AbstractAgentProxy(org.apache.sshd.common.util.threads.CloseableExecutorService executorService)
-
-
Method Details
-
getChannelType
-
setChannelType
-
getExecutorService
public org.apache.sshd.common.util.threads.CloseableExecutorService getExecutorService()- Specified by:
getExecutorServicein interfaceorg.apache.sshd.common.util.threads.ExecutorServiceCarrier
-
getIdentities
- Specified by:
getIdentitiesin interfaceSshAgent- 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:
signin interfaceSshAgent- Parameters:
session- The currentSessionContextkey- ThePublicKeyto use for signingalgo- Recommended signature algorithm - ifnull/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 anotherdata- 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:SshAgentAdds a key to the agent.- Specified by:
addIdentityin interfaceSshAgent- Parameters:
kp-KeyPairto addcomment- to associate with the keyconstraints-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
- Specified by:
removeIdentityin interfaceSshAgent- Throws:
IOException
-
removeAllIdentities
- Specified by:
removeAllIdentitiesin interfaceSshAgent- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- 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
-