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:
Closeable
,AutoCloseable
,Channel
,SshAgent
,ExecutorServiceCarrier
public abstract class AbstractAgentProxy
extends AbstractLoggingBean
implements SshAgent, ExecutorServiceCarrier
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotected
AbstractAgentProxy
(CloseableExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIdentity
(KeyPair kp, String comment) void
close()
protected Buffer
createBuffer
(byte cmd) protected Buffer
createBuffer
(byte cmd, int extraLen) protected Buffer
void
void
removeIdentity
(PublicKey key) protected abstract Buffer
void
setChannelType
(String channelType) sign
(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, warn
-
Field Details
-
executor
-
channelType
-
-
Constructor Details
-
AbstractAgentProxy
-
-
Method Details
-
getChannelType
-
setChannelType
-
getExecutorService
- Specified by:
getExecutorService
in interfaceExecutorServiceCarrier
- Returns:
- The
CloseableExecutorService
to use
-
getIdentities
- Specified by:
getIdentities
in interfaceSshAgent
- Throws:
IOException
-
sign
public Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException - Specified by:
sign
in interfaceSshAgent
- Parameters:
session
- The currentSessionContext
key
- ThePublicKey
to 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
- Specified by:
addIdentity
in interfaceSshAgent
- Throws:
IOException
-
removeIdentity
- Specified by:
removeIdentity
in interfaceSshAgent
- Throws:
IOException
-
removeAllIdentities
- Specified by:
removeAllIdentities
in interfaceSshAgent
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
createBuffer
-
createBuffer
-
prepare
-
request
- Throws:
IOException
-