Top Description Fields Constructors Methods
org.apache.sshd.client.auth.pubkey

public Class KeyAgentIdentity

extends Object
implements PublicKeyIdentity
Class Inheritance
All Implemented Interfaces
org.apache.sshd.client.auth.pubkey.PublicKeyIdentity
Imports
java.security.KeyPair, .PublicKey, java.util.Map, .Objects, org.apache.sshd.agent.SshAgent, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.session.SessionContext

Uses an SshAgent to generate the identity signature
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final SshAgent
private final String
private final KeyPair
private KeyPair

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
public KeyPair
public Map.Entry<String, byte[]>
sign(SessionContext
The SessionContext for calling this method - may be null if not called within a session context
session
,
String
Recommended signature algorithm - if null/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 another

algo
,
byte[]
Data to sign
data
)

Implements org.apache.sshd.client.auth.pubkey.PublicKeyIdentity.sign.

Proves the public key identity by signing the given data

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

agentback to summary
private final SshAgent agent
commentback to summary
private final String comment
keyPairback to summary
private final KeyPair keyPair
resolvedPairback to summary
private KeyPair resolvedPair

Constructor Detail

KeyAgentIdentityback to summary
public KeyAgentIdentity(SshAgent agent, PublicKey key, String comment)

Method Detail

getCommentback to summary
public String getComment()
getKeyIdentityback to summary
public KeyPair getKeyIdentity()

Implements org.apache.sshd.client.auth.pubkey.PublicKeyIdentity.getKeyIdentity.

Returns:KeyPair

Doc from org.apache.sshd.client.auth.pubkey.PublicKeyIdentity.getKeyIdentity.

The KeyPair identity value

Annotations
@Override
signback to summary
public Map.Entry<String, byte[]> sign(SessionContext session, String algo, byte[] data) throws Exception

Implements org.apache.sshd.client.auth.pubkey.PublicKeyIdentity.sign.

Doc from org.apache.sshd.client.auth.pubkey.PublicKeyIdentity.sign.

Proves the public key identity by signing the given data

Parameters
session:SessionContext

The SessionContext for calling this method - may be null if not called within a session context

algo:String

Recommended signature algorithm - if null/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 another

data:byte[]

Data to sign

Returns:Map.Entry<String, byte[]>

used algorithm + signed data - using the identity

Annotations
@Override
Exceptions
Exception:
If failed to sign the data
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override