Class KeyAgentIdentity
- java.lang.Object
-
- org.apache.sshd.client.auth.pubkey.KeyAgentIdentity
-
- All Implemented Interfaces:
PublicKeyIdentity
public class KeyAgentIdentity extends java.lang.Object implements PublicKeyIdentity
Uses anSshAgentto generate the identity signature
-
-
Constructor Summary
Constructors Constructor Description KeyAgentIdentity(SshAgent agent, java.security.PublicKey key, java.lang.String comment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetComment()java.security.PublicKeygetPublicKey()byte[]sign(SessionContext session, byte[] data)Proves the public key identity by signing the given datajava.lang.StringtoString()
-
-
-
Field Detail
-
agent
private final SshAgent agent
-
key
private final java.security.PublicKey key
-
comment
private final java.lang.String comment
-
-
Constructor Detail
-
KeyAgentIdentity
public KeyAgentIdentity(SshAgent agent, java.security.PublicKey key, java.lang.String comment)
-
-
Method Detail
-
getPublicKey
public java.security.PublicKey getPublicKey()
- Specified by:
getPublicKeyin interfacePublicKeyIdentity- Returns:
- The
PublicKeyidentity value
-
getComment
public java.lang.String getComment()
-
sign
public byte[] sign(SessionContext session, byte[] data) throws java.lang.Exception
Description copied from interface:PublicKeyIdentityProves the public key identity by signing the given data- Specified by:
signin interfacePublicKeyIdentity- Parameters:
session- TheSessionContextfor calling this method - may benullif not called within a session contextdata- Data to sign- Returns:
- Signed data - using the identity
- Throws:
java.lang.Exception- If failed to sign the data
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-