Package org.apache.sshd.agent
Interface SshAgent
- All Superinterfaces:
AutoCloseable,Channel,Closeable
- All Known Implementing Classes:
AbstractAgentProxy,AgentDelegate,AgentImpl
SSH key agent server
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentity(KeyPair key, String comment, SshAgentKeyConstraint... constraints) Adds a key to the agent.voidvoidremoveIdentity(PublicKey key) default KeyPairUsed 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 currentSessionContextkey- ThePublicKeyto 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-KeyPairto addcomment- to associate with the keyconstraints-SshAgentKeyConstraints 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
-