Package org.apache.sshd.agent.common
Class AgentDelegate
java.lang.Object
org.apache.sshd.agent.common.AgentDelegate
- All Implemented Interfaces:
Closeable,AutoCloseable,Channel,SshAgent
-
Field Summary
FieldsFields inherited from interface org.apache.sshd.agent.SshAgent
SSH_AUTHSOCKET_ENV_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIdentity(KeyPair key, String comment) voidclose()booleanisOpen()voidvoidremoveIdentity(PublicKey key) sign(SessionContext session, PublicKey key, String algo, byte[] data)
-
Field Details
-
agent
-
-
Constructor Details
-
AgentDelegate
-
-
Method Details
-
isOpen
public boolean isOpen() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getIdentities
- Specified by:
getIdentitiesin interfaceSshAgent- Throws:
IOException
-
sign
public Map.Entry<String,byte[]> sign(SessionContext session, PublicKey key, String algo, byte[] data) throws IOException - Specified by:
signin interfaceSshAgent- 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
-
addIdentity
- Specified by:
addIdentityin interfaceSshAgent- Throws:
IOException
-
removeIdentity
- Specified by:
removeIdentityin interfaceSshAgent- Throws:
IOException
-
removeAllIdentities
- Specified by:
removeAllIdentitiesin interfaceSshAgent- Throws:
IOException
-