Top Description Fields Constructors Methods
org.apache.sshd.common.keyprovider

public Class MappedKeyPairProvider

extends Object
implements KeyPairProvider
Class Inheritance
All Implemented Interfaces
org.apache.sshd.common.keyprovider.KeyPairProvider, org.apache.sshd.common.keyprovider.KeyIdentityProvider
Imports
java.security.KeyPair, java.util.Arrays, .Collection, .Collections, .Map, .TreeMap, java.util.function.Function, org.apache.sshd.common.config.keys.KeyUtils, org.apache.sshd.common.session.SessionContext, org.apache.sshd.common.util.GenericUtils, .ValidateUtils

Holds a Map of String->KeyPair where the map key is the type and value is the associated KeyPair
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
public static final Function<Map<String, KeyPair>, KeyPairProvider>
MAP_TO_KEY_PAIR_PROVIDER

Transforms a Map of String->KeyPair to a KeyPairProvider where map key is the type and value is the associated KeyPair

private final Map<String, KeyPair>

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public Iterable<String>
getKeyTypes(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
)

Overrides default org.apache.sshd.common.keyprovider.KeyPairProvider.getKeyTypes.

public KeyPair
loadKey(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).
session
,
String
the type of key to load
type
)

Overrides default org.apache.sshd.common.keyprovider.KeyPairProvider.loadKey.

Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or "ecdsa-sha2-nistp{256,384,521}".

public Iterable<KeyPair>
loadKeys(SessionContext
The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
session
)

Implements org.apache.sshd.common.keyprovider.KeyIdentityProvider.loadKeys.

Load available keys.

public static Map<String, KeyPair>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

MAP_TO_KEY_PAIR_PROVIDERback to summary
public static final Function<Map<String, KeyPair>, KeyPairProvider> MAP_TO_KEY_PAIR_PROVIDER

Transforms a Map of String->KeyPair to a KeyPairProvider where map key is the type and value is the associated KeyPair

pairsMapback to summary
private final Map<String, KeyPair> pairsMap

Constructor Detail

MappedKeyPairProviderback to summary
public MappedKeyPairProvider(KeyPair... pairs)
MappedKeyPairProviderback to summary
public MappedKeyPairProvider(Collection<KeyPair> pairs)
MappedKeyPairProviderback to summary
public MappedKeyPairProvider(Map<String, KeyPair> pairsMap)

Method Detail

getKeyTypesback to summary
public Iterable<String> getKeyTypes(SessionContext session)

Overrides default org.apache.sshd.common.keyprovider.KeyPairProvider.getKeyTypes.

Parameters
session:SessionContext

Doc from org.apache.sshd.common.keyprovider.KeyPairProvider.getKeyTypes.

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

Returns:Iterable<String>

Doc from org.apache.sshd.common.keyprovider.KeyPairProvider.getKeyTypes.

The available Iterable key types - never null

Annotations
@Override
loadKeyback to summary
public KeyPair loadKey(SessionContext session, String type)

Overrides default org.apache.sshd.common.keyprovider.KeyPairProvider.loadKey.

Doc from org.apache.sshd.common.keyprovider.KeyPairProvider.loadKey.

Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or "ecdsa-sha2-nistp{256,384,521}". If there is no key of this type, return null

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool).

type:String

the type of key to load

Returns:KeyPair

a valid key pair or null if this type of key is not available

Annotations
@Override
loadKeysback to summary
public Iterable<KeyPair> loadKeys(SessionContext session)

Implements org.apache.sshd.common.keyprovider.KeyIdentityProvider.loadKeys.

Doc from org.apache.sshd.common.keyprovider.KeyIdentityProvider.loadKeys.

Load available keys.

Parameters
session:SessionContext

The SessionContext for invoking this load command - may be null if not invoked within a session context (e.g., offline tool or session unknown).

Returns:Iterable<KeyPair>

an Iterable instance of available keys - ignored if null

Annotations
@Override
mapUniquePairsback to summary
public static Map<String, KeyPair> mapUniquePairs(Collection<KeyPair> pairs)
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