Class MappedKeyPairProvider
java.lang.Object
org.apache.sshd.common.keyprovider.MappedKeyPairProvider
- All Implemented Interfaces:
KeyIdentityProvider
,KeyPairProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Function
<Map<String, KeyPair>, KeyPairProvider> Transforms aMap
ofString
->KeyPair
to aKeyPairProvider
where map key is the type and value is the associatedKeyPair
Fields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDER
Fields inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider
ECDSA_SHA2_NISTP256, ECDSA_SHA2_NISTP384, ECDSA_SHA2_NISTP521, EMPTY_KEYPAIR_PROVIDER, SSH_DSS, SSH_DSS_CERT, SSH_ECDSA_SHA2_NISTP256_CERT, SSH_ECDSA_SHA2_NISTP384_CERT, SSH_ECDSA_SHA2_NISTP521_CERT, SSH_ED25519, SSH_ED25519_CERT, SSH_RSA, SSH_RSA_CERT
-
Constructor Summary
ConstructorsConstructorDescriptionMappedKeyPairProvider
(KeyPair... pairs) MappedKeyPairProvider
(Collection<KeyPair> pairs) MappedKeyPairProvider
(Map<String, KeyPair> pairsMap) -
Method Summary
Modifier and TypeMethodDescriptiongetKeyTypes
(SessionContext session) loadKey
(SessionContext session, String type) Load a key of the specified type which can be "ssh-rsa", "ssh-dss", or "ecdsa-sha2-nistp{256,384,521}".loadKeys
(SessionContext session) Load available keys.mapUniquePairs
(Collection<KeyPair> pairs) toString()
-
Field Details
-
MAP_TO_KEY_PAIR_PROVIDER
Transforms aMap
ofString
->KeyPair
to aKeyPairProvider
where map key is the type and value is the associatedKeyPair
-
pairsMap
-
-
Constructor Details
-
MappedKeyPairProvider
-
MappedKeyPairProvider
-
MappedKeyPairProvider
-
-
Method Details
-
loadKeys
Description copied from interface:KeyIdentityProvider
Load available keys.- Specified by:
loadKeys
in interfaceKeyIdentityProvider
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool or session unknown).- Returns:
- an
Iterable
instance of available keys - ignored ifnull
-
loadKey
Description copied from interface:KeyPairProvider
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, returnnull
- Specified by:
loadKey
in interfaceKeyPairProvider
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).type
- the type of key to load- Returns:
- a valid key pair or
null
if this type of key is not available
-
getKeyTypes
- Specified by:
getKeyTypes
in interfaceKeyPairProvider
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).- Returns:
- The available
Iterable
key types - nevernull
-
toString
-
mapUniquePairs
-