Package org.apache.sshd.agent
Interface SshAgent
- All Superinterfaces:
AutoCloseable
,Channel
,Closeable
- All Known Implementing Classes:
AbstractAgentProxy
,AgentClient
,AgentDelegate
,AgentImpl
SSH key agent server
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addIdentity
(KeyPair key, String comment, SshAgentKeyConstraint... constraints) Adds a key to the agent.void
void
removeIdentity
(PublicKey key) default KeyPair
Used for reporting client-side public key authentication via agentsign
(SessionContext session, PublicKey key, String algo, byte[] data)
-
Field Details
-
SSH_AUTHSOCKET_ENV_NAME
- See Also:
-
-
Method Details
-
getIdentities
- 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
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
- Throws:
IOException
-
removeAllIdentities
- Throws:
IOException
-