Class FileKeyPairProvider
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.common.keyprovider.AbstractKeyPairProvider
org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider<Path>
org.apache.sshd.common.keyprovider.FileKeyPairProvider
- All Implemented Interfaces:
KeyIdentityProvider,KeyPairProvider
This host key provider loads private keys from the specified files. The loading is lazy - i.e., a file is not
loaded until it is actually required. Once required though, its loaded
KeyPair result is cached and
not re-loaded.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider
AbstractResourceKeyPairProvider.KeyPairIterator -
Field Summary
FieldsFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
logFields 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
ConstructorsConstructorDescriptionFileKeyPairProvider(Path path) FileKeyPairProvider(Path... files) FileKeyPairProvider(Collection<? extends Path> files) -
Method Summary
Modifier and TypeMethodDescriptiondoLoadKeys(SessionContext session, Path resource) protected IoResource<Path> getIoResource(SessionContext session, Path resource) Collection<? extends Path> getPaths()loadKeys(SessionContext session) Load available keys.voidsetPaths(Collection<? extends Path> paths) Methods inherited from class org.apache.sshd.common.keyprovider.AbstractResourceKeyPairProvider
doLoadKeys, doLoadKeys, getPasswordFinder, loadKeys, openKeyPairResource, resetCacheMap, setPasswordFinderMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sshd.common.keyprovider.KeyPairProvider
getKeyTypes, loadKey
-
Field Details
-
files
-
-
Constructor Details
-
FileKeyPairProvider
public FileKeyPairProvider() -
FileKeyPairProvider
-
FileKeyPairProvider
-
FileKeyPairProvider
-
-
Method Details
-
getPaths
-
setPaths
-
loadKeys
Description copied from interface:KeyIdentityProviderLoad available keys.- 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
-
getIoResource
- Overrides:
getIoResourcein classAbstractResourceKeyPairProvider<Path>
-
doLoadKeys
protected Iterable<KeyPair> doLoadKeys(SessionContext session, Path resource) throws IOException, GeneralSecurityException - Overrides:
doLoadKeysin classAbstractResourceKeyPairProvider<Path>- Throws:
IOExceptionGeneralSecurityException
-