Class SshAgentClient
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.agent.SshAgentClient
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,org.apache.sshd.agent.SshAgent
public class SshAgentClient extends Object implements org.apache.sshd.agent.SshAgent
A client for an SSH2 agent. This client supports only querying identities and signature requests.- See Also:
- SSH Agent Protocol, RFC draft
-
-
Constructor Summary
Constructors Constructor Description SshAgentClient(Connector connector)
Creates a newSshAgentClient
implementing the SSH2 ssh agent protocol, using the givenConnector
to connect to the SSH agent and to exchange messages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addIdentity(KeyPair key, String comment)
void
close()
Iterable<? extends Map.Entry<PublicKey,String>>
getIdentities()
boolean
isOpen()
void
removeAllIdentities()
void
removeIdentity(PublicKey key)
Map.Entry<String,byte[]>
sign(org.apache.sshd.common.session.SessionContext session, PublicKey key, String algorithm, byte[] data)
-
-
-
Constructor Detail
-
SshAgentClient
public SshAgentClient(Connector connector)
Creates a newSshAgentClient
implementing the SSH2 ssh agent protocol, using the givenConnector
to connect to the SSH agent and to exchange messages.- Parameters:
connector
-Connector
to use
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getIdentities
public Iterable<? extends Map.Entry<PublicKey,String>> getIdentities() throws IOException
- Specified by:
getIdentities
in interfaceorg.apache.sshd.agent.SshAgent
- Throws:
IOException
-
sign
public Map.Entry<String,byte[]> sign(org.apache.sshd.common.session.SessionContext session, PublicKey key, String algorithm, byte[] data) throws IOException
- Specified by:
sign
in interfaceorg.apache.sshd.agent.SshAgent
- Throws:
IOException
-
addIdentity
public void addIdentity(KeyPair key, String comment) throws IOException
- Specified by:
addIdentity
in interfaceorg.apache.sshd.agent.SshAgent
- Throws:
IOException
-
removeIdentity
public void removeIdentity(PublicKey key) throws IOException
- Specified by:
removeIdentity
in interfaceorg.apache.sshd.agent.SshAgent
- Throws:
IOException
-
removeAllIdentities
public void removeAllIdentities() throws IOException
- Specified by:
removeAllIdentities
in interfaceorg.apache.sshd.agent.SshAgent
- Throws:
IOException
-
-