Module org.eclipse.jgit.ssh.apache
Class SshAgentClient
java.lang.Object
org.eclipse.jgit.internal.transport.sshd.agent.SshAgentClient
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,org.apache.sshd.agent.SshAgent
A client for an SSH2 agent. This client supports querying identities,
signature requests, and adding keys to an agent (with or without
constraints). Removing keys is not supported, and the older SSH1 protocol is
not supported.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.sshd.agent.SshAgent
SSH_AUTHSOCKET_ENV_NAME -
Constructor Summary
ConstructorsConstructorDescriptionSshAgentClient(Connector connector) Creates a newSshAgentClientimplementing the SSH2 ssh agent protocol, using the givenConnectorto connect to the SSH agent and to exchange messages. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentity(KeyPair key, String comment, org.apache.sshd.agent.SshAgentKeyConstraint... constraints) voidclose()booleanisOpen()voidvoidremoveIdentity(PublicKey key) sign(org.apache.sshd.common.session.SessionContext session, PublicKey key, String algorithm, byte[] data) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.agent.SshAgent
resolveLocalIdentity
-
Constructor Details
-
SshAgentClient
Creates a newSshAgentClientimplementing the SSH2 ssh agent protocol, using the givenConnectorto connect to the SSH agent and to exchange messages.- Parameters:
connector-Connectorto use
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getIdentities
- Specified by:
getIdentitiesin 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:
signin interfaceorg.apache.sshd.agent.SshAgent- Throws:
IOException
-
addIdentity
public void addIdentity(KeyPair key, String comment, org.apache.sshd.agent.SshAgentKeyConstraint... constraints) throws IOException - Specified by:
addIdentityin interfaceorg.apache.sshd.agent.SshAgent- Throws:
IOException
-
isOpen
public boolean isOpen() -
removeIdentity
- Specified by:
removeIdentityin interfaceorg.apache.sshd.agent.SshAgent- Throws:
IOException
-
removeAllIdentities
- Specified by:
removeAllIdentitiesin interfaceorg.apache.sshd.agent.SshAgent- Throws:
IOException
-