Package org.apache.sshd.agent
Interface SshAgent
-
- All Superinterfaces:
AutoCloseable
,Channel
,Closeable
- All Known Implementing Classes:
AbstractAgentProxy
,AgentClient
,AgentDelegate
,AgentImpl
public interface SshAgent extends Channel
SSH key agent server
-
-
Field Summary
Fields Modifier and Type Field Description static String
SSH_AUTHSOCKET_ENV_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addIdentity(KeyPair key, String comment, SshAgentKeyConstraint... constraints)
Adds a key to the agent.Iterable<? extends Map.Entry<PublicKey,String>>
getIdentities()
void
removeAllIdentities()
void
removeIdentity(PublicKey key)
default KeyPair
resolveLocalIdentity(PublicKey key)
Used for reporting client-side public key authentication via agentMap.Entry<String,byte[]>
sign(SessionContext session, PublicKey key, String algo, byte[] data)
-
-
-
Field Detail
-
SSH_AUTHSOCKET_ENV_NAME
static final String SSH_AUTHSOCKET_ENV_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdentities
Iterable<? extends Map.Entry<PublicKey,String>> getIdentities() throws IOException
- Throws:
IOException
-
sign
Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException
- Parameters:
session
- The currentSessionContext
key
- ThePublicKey
to use for signingalgo
- Recommended signature algorithm - ifnull
/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 sign- Returns:
- used algorithm + signed data - using the identity
- Throws:
IOException
- If failed to sign
-
resolveLocalIdentity
default KeyPair resolveLocalIdentity(PublicKey key)
Used for reporting client-side public key authentication via agent
-
addIdentity
void addIdentity(KeyPair key, String comment, SshAgentKeyConstraint... constraints) throws IOException
Adds a key to the agent.- Parameters:
key
-KeyPair
to addcomment
- to associate with the keyconstraints
-SshAgentKeyConstraint
s for this key to pass on to the agent- Throws:
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
-
removeIdentity
void removeIdentity(PublicKey key) throws IOException
- Throws:
IOException
-
removeAllIdentities
void removeAllIdentities() throws IOException
- Throws:
IOException
-
-