Class KeyAgentIdentity
java.lang.Object
org.apache.sshd.client.auth.pubkey.KeyAgentIdentity
- All Implemented Interfaces:
PublicKeyIdentity
Uses an
SshAgent
to generate the identity signature-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsign
(SessionContext session, String algo, byte[] data) Proves the public key identity by signing the given datatoString()
-
Field Details
-
agent
-
key
-
comment
-
-
Constructor Details
-
KeyAgentIdentity
-
-
Method Details
-
getPublicKey
- Specified by:
getPublicKey
in interfacePublicKeyIdentity
- Returns:
- The
PublicKey
identity value
-
getComment
-
sign
public Map.Entry<String,byte[]> sign(SessionContext session, String algo, byte[] data) throws Exception Description copied from interface:PublicKeyIdentity
Proves the public key identity by signing the given data- Specified by:
sign
in interfacePublicKeyIdentity
- Parameters:
session
- TheSessionContext
for calling this method - may benull
if not called within a session contextalgo
- 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:
Exception
- If failed to sign the data
-
toString
-