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 aMapofString->KeyPairto aKeyPairProviderwhere map key is the type and value is the associatedKeyPairFields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDERFields 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 aMapofString->KeyPairto aKeyPairProviderwhere map key is the type and value is the associatedKeyPair -
pairsMap
-
-
Constructor Details
-
MappedKeyPairProvider
-
MappedKeyPairProvider
-
MappedKeyPairProvider
-
-
Method Details
-
loadKeys
Description copied from interface:KeyIdentityProviderLoad available keys.- Specified by:
loadKeysin interfaceKeyIdentityProvider- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool or session unknown).- Returns:
- an
Iterableinstance of available keys - ignored ifnull
-
loadKey
Description copied from interface:KeyPairProviderLoad 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:
loadKeyin interfaceKeyPairProvider- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).type- the type of key to load- Returns:
- a valid key pair or
nullif this type of key is not available
-
getKeyTypes
- Specified by:
getKeyTypesin interfaceKeyPairProvider- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).- Returns:
- The available
Iterablekey types - nevernull
-
toString
-
mapUniquePairs
-