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

public Class KeyPairIdentity

extends Object
implements PublicKeyIdentity, SignatureFactoriesHolder
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.signature.SignatureFactoriesHolder, org.apache.sshd.client.auth.pubkey.PublicKeyIdentity
Imports
java.security.KeyPair, .PublicKey, java.util.AbstractMap.SimpleImmutableEntry, .Collections, .List, .Map, .Objects, org.apache.sshd.common.NamedFactory, .NamedResource, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.signature.Signature, .SignatureFactoriesHolder, .SignatureFactoriesManager, .SignatureFactory, org.apache.sshd.common.util.GenericUtils, .ValidateUtils

Uses a KeyPair to generate the identity signature
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final KeyPair
private final List<NamedFactory<Signature>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public KeyPair
public List<NamedFactory<Signature>>
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

pairback to summary
private final KeyPair pair
signatureFactoriesback to summary
private final List<NamedFactory<Signature>> signatureFactories

Constructor Detail

KeyPairIdentityback to summary
public KeyPairIdentity(SignatureFactoriesManager primary, SignatureFactoriesManager secondary, KeyPair pair)

Method Detail

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
getSignatureFactoriesback to summary
public List<NamedFactory<Signature>> getSignatureFactories()

Implements org.apache.sshd.common.signature.SignatureFactoriesHolder.getSignatureFactories.

Returns:List<NamedFactory<Signature>>

Doc from org.apache.sshd.common.signature.SignatureFactoriesHolder.getSignatureFactories.

The list of named Signature factories

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