Top Fields Constructors Methods
org.apache.sshd.agent.common

public abstract Class AbstractAgentProxy

extends AbstractLoggingBean
implements SshAgent, ExecutorServiceCarrier
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.util.threads.ExecutorServiceCarrier, org.apache.sshd.agent.SshAgent, java.nio.channels.Channel, java.io.Closeable, java.lang.AutoCloseable
Known Direct Subclasses
org.apache.sshd.agent.unix.AgentClient
Imports
java.io.IOException, java.security.KeyPair, .PublicKey, java.util.AbstractMap.SimpleImmutableEntry, .ArrayList, .Collection, .List, .Map, org.apache.sshd.agent.SshAgent, .SshAgentConstants, .SshAgentKeyConstraint, org.apache.sshd.common.SshException, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.buffer.Buffer, .BufferUtils, .ByteArrayBuffer, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.common.util.threads.CloseableExecutorService, .ExecutorServiceCarrier, org.apache.sshd.core.CoreModuleProperties

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private String
private CloseableExecutorService
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public void
addIdentity(KeyPair
KeyPair to add
kp
,
String
to associate with the key
comment
,
SshAgentKeyConstraint...
SshAgentKeyConstraints for this key to pass on to the agent
constraints
)

Implements org.apache.sshd.agent.SshAgent.addIdentity.

Adds a key to the agent.

public void
close()

Implements java.nio.channels.Channel.close.

Closes this channel.

protected Buffer
createBuffer(byte cmd)

protected Buffer
createBuffer(byte cmd, int extraLen)

public String
public CloseableExecutorService
public Iterable<? extends Map.Entry<PublicKey, String>>
protected Buffer
prepare(Buffer buffer)

public void
public void
protected abstract Buffer
request(Buffer buffer)

public void
setChannelType(String channelType)

public Map.Entry<String, byte[]>
sign(SessionContext
The current SessionContext
session
,
PublicKey
The PublicKey to use for signing
key
,
String
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 another

algo
,
byte[]
Data to sign
data
)

Implements org.apache.sshd.agent.SshAgent.sign.

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

channelTypeback to summary
private String channelType
executorback to summary
private CloseableExecutorService executor

Constructor Detail

AbstractAgentProxyback to summary
protected AbstractAgentProxy(CloseableExecutorService executorService)

Method Detail

addIdentityback to summary
public void addIdentity(KeyPair kp, String comment, SshAgentKeyConstraint... constraints) throws IOException

Implements org.apache.sshd.agent.SshAgent.addIdentity.

Doc from org.apache.sshd.agent.SshAgent.addIdentity.

Adds a key to the agent.

Parameters
kp:KeyPair

KeyPair to add

comment:String

to associate with the key

constraints:SshAgentKeyConstraint[]

SshAgentKeyConstraints for this key to pass on to the agent

Annotations
@Override
Exceptions
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
closeback to summary
public void close() throws IOException

Implements java.nio.channels.Channel.close.

Doc from java.nio.channels.Channel.close.

Closes this channel.

After a channel is closed, any further attempt to invoke I/O operations upon it will cause a ClosedChannelException to be thrown.

If this channel is already closed then invoking this method has no effect.

This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.

Annotations
@Override
Exceptions
IOException:
If an I/O error occurs
createBufferback to summary
protected Buffer createBuffer(byte cmd)
createBufferback to summary
protected Buffer createBuffer(byte cmd, int extraLen)
getChannelTypeback to summary
public String getChannelType()
getExecutorServiceback to summary
public CloseableExecutorService getExecutorService()

Implements org.apache.sshd.common.util.threads.ExecutorServiceCarrier.getExecutorService.

Returns:CloseableExecutorService

Doc from org.apache.sshd.common.util.threads.ExecutorServiceCarrier.getExecutorService.

The CloseableExecutorService to use

Annotations
@Override
getIdentitiesback to summary
public Iterable<? extends Map.Entry<PublicKey, String>> getIdentities() throws IOException

Implements org.apache.sshd.agent.SshAgent.getIdentities.

Annotations
@Override
prepareback to summary
protected Buffer prepare(Buffer buffer)
removeAllIdentitiesback to summary
public void removeAllIdentities() throws IOException

Implements org.apache.sshd.agent.SshAgent.removeAllIdentities.

Annotations
@Override
removeIdentityback to summary
public void removeIdentity(PublicKey key) throws IOException

Implements org.apache.sshd.agent.SshAgent.removeIdentity.

Annotations
@Override
requestback to summary
protected abstract Buffer request(Buffer buffer) throws IOException
setChannelTypeback to summary
public void setChannelType(String channelType)
signback to summary
public Map.Entry<String, byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException

Implements org.apache.sshd.agent.SshAgent.sign.

Parameters
session:SessionContext

Doc from org.apache.sshd.agent.SshAgent.sign.

The current SessionContext

key:PublicKey

Doc from org.apache.sshd.agent.SshAgent.sign.

The PublicKey to use for signing

algo:String

Doc from org.apache.sshd.agent.SshAgent.sign.

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 another

data:byte[]

Doc from org.apache.sshd.agent.SshAgent.sign.

Data to sign

Returns:Map.Entry<String, byte[]>

Doc from org.apache.sshd.agent.SshAgent.sign.

used algorithm + signed data - using the identity

Annotations
@Override
Exceptions
IOException:

Doc from org.apache.sshd.agent.SshAgent.sign.

If failed to sign