Class KeyAgentIdentity
- java.lang.Object
-
- org.apache.sshd.client.auth.pubkey.KeyAgentIdentity
-
- All Implemented Interfaces:
PublicKeyIdentity
public class KeyAgentIdentity extends Object implements PublicKeyIdentity
Uses anSshAgent
to generate the identity signature- Author:
- Apache MINA SSHD Project
-
-
Constructor Summary
Constructors Constructor Description KeyAgentIdentity(SshAgent agent, PublicKey key, String comment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getComment()
KeyPair
getKeyIdentity()
Map.Entry<String,byte[]>
sign(SessionContext session, String algo, byte[] data)
Proves the public key identity by signing the given dataString
toString()
-
-
-
Method Detail
-
getKeyIdentity
public KeyPair getKeyIdentity()
- Specified by:
getKeyIdentity
in interfacePublicKeyIdentity
- Returns:
- The
KeyPair
identity value
-
getComment
public String 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
-
-