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()
PublicKey
getPublicKey()
byte[]
sign(SessionContext session, byte[] data)
Proves the public key identity by signing the given dataString
toString()
-
-
-
Method Detail
-
getPublicKey
public PublicKey getPublicKey()
- Specified by:
getPublicKey
in interfacePublicKeyIdentity
- Returns:
- The
PublicKey
identity value
-
getComment
public String getComment()
-
sign
public byte[] sign(SessionContext session, 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 contextdata
- Data to sign- Returns:
- Signed data - using the identity
- Throws:
Exception
- If failed to sign the data
-
-