public abstract class AbstractAgentProxy extends AbstractLoggingBean implements SshAgent, ExecutorServiceCarrier
log
SSH_AUTHSOCKET_ENV_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractAgentProxy(CloseableExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
void |
addIdentity(KeyPair kp,
String comment,
SshAgentKeyConstraint... constraints)
Adds a key to the agent.
|
void |
close() |
protected Buffer |
createBuffer(byte cmd) |
protected Buffer |
createBuffer(byte cmd,
int extraLen) |
String |
getChannelType() |
CloseableExecutorService |
getExecutorService() |
Iterable<? extends Map.Entry<PublicKey,String>> |
getIdentities() |
protected Buffer |
prepare(Buffer buffer) |
void |
removeAllIdentities() |
void |
removeIdentity(PublicKey key) |
protected abstract Buffer |
request(Buffer buffer) |
void |
setChannelType(String channelType) |
Map.Entry<String,byte[]> |
sign(SessionContext session,
PublicKey key,
String algo,
byte[] data) |
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
resolveLocalIdentity
protected AbstractAgentProxy(CloseableExecutorService executorService)
public String getChannelType()
public void setChannelType(String channelType)
public CloseableExecutorService getExecutorService()
getExecutorService
in interface ExecutorServiceCarrier
CloseableExecutorService
to usepublic Iterable<? extends Map.Entry<PublicKey,String>> getIdentities() throws IOException
getIdentities
in interface SshAgent
IOException
public Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException
sign
in interface SshAgent
session
- The current SessionContext
key
- 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 signIOException
- If failed to signpublic void addIdentity(KeyPair kp, String comment, SshAgentKeyConstraint... constraints) throws IOException
SshAgent
addIdentity
in interface SshAgent
kp
- KeyPair
to addcomment
- to associate with the keyconstraints
- SshAgentKeyConstraint
s for this key to pass on to the agentIOException
- 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(PublicKey key) throws IOException
removeIdentity
in interface SshAgent
IOException
public void removeAllIdentities() throws IOException
removeAllIdentities
in interface SshAgent
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
IOException
protected Buffer createBuffer(byte cmd)
protected Buffer createBuffer(byte cmd, int extraLen)
protected abstract Buffer request(Buffer buffer) throws IOException
IOException
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.