public abstract class AbstractAgentProxy extends AbstractLoggingBean implements SshAgent, ExecutorServiceCarrier
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
channelType |
private CloseableExecutorService |
executor |
logSSH_AUTHSOCKET_ENV_NAME| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAgentProxy(CloseableExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentity(java.security.KeyPair kp,
java.lang.String comment,
SshAgentKeyConstraint... constraints)
Adds a key to the agent.
|
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) |
java.util.Map.Entry<java.lang.String,byte[]> |
sign(SessionContext session,
java.security.PublicKey key,
java.lang.String algo,
byte[] data) |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresolveLocalIdentityprivate CloseableExecutorService executor
private java.lang.String channelType
protected AbstractAgentProxy(CloseableExecutorService executorService)
public java.lang.String getChannelType()
public void setChannelType(java.lang.String channelType)
public CloseableExecutorService getExecutorService()
getExecutorService in interface ExecutorServiceCarrierCloseableExecutorService to usepublic java.lang.Iterable<? extends java.util.Map.Entry<java.security.PublicKey,java.lang.String>> getIdentities()
throws java.io.IOException
getIdentities in interface SshAgentjava.io.IOExceptionpublic java.util.Map.Entry<java.lang.String,byte[]> sign(SessionContext session, java.security.PublicKey key, java.lang.String algo, byte[] data) throws java.io.IOException
sign in interface SshAgentsession - The current SessionContextkey - The PublicKey to use for signingalgo - 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 anotherdata - Data to signjava.io.IOException - If failed to signpublic void addIdentity(java.security.KeyPair kp,
java.lang.String comment,
SshAgentKeyConstraint... constraints)
throws java.io.IOException
SshAgentaddIdentity in interface SshAgentkp - KeyPair to addcomment - to associate with the keyconstraints - SshAgentKeyConstraints for this key to pass on to the agentjava.io.IOException - if an error in the communication with the agent occurred, or the agent did not return a reply
indicating successful addition of the keypublic void removeIdentity(java.security.PublicKey key)
throws java.io.IOException
removeIdentity in interface SshAgentjava.io.IOExceptionpublic void removeAllIdentities()
throws java.io.IOException
removeAllIdentities in interface SshAgentjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channeljava.io.IOExceptionprotected Buffer createBuffer(byte cmd)
protected Buffer createBuffer(byte cmd, int extraLen)