Class LazyClientKeyIdentityProvider
java.lang.Object
org.apache.sshd.client.config.keys.LazyClientKeyIdentityProvider
- All Implemented Interfaces:
ClientIdentityLoaderHolder
,FilePasswordProviderHolder
,KeyIdentityProvider
public class LazyClientKeyIdentityProvider
extends Object
implements KeyIdentityProvider, ClientIdentityLoaderHolder, FilePasswordProviderHolder
TODO Add javadoc
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientIdentityLoader
private final boolean
private final Collection<? extends NamedResource>
private final FilePasswordProvider
Fields inherited from interface org.apache.sshd.common.keyprovider.KeyIdentityProvider
EMPTY_KEYS_PROVIDER
-
Constructor Summary
ConstructorsConstructorDescriptionLazyClientKeyIdentityProvider
(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting) -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends NamedResource>
boolean
loadClientIdentities
(SessionContext session, NamedResource location) loadKeys
(SessionContext session) Load available keys.
-
Field Details
-
clientIdentityLoader
-
locations
-
passwordProvider
-
ignoreNonExisting
private final boolean ignoreNonExisting
-
-
Constructor Details
-
LazyClientKeyIdentityProvider
public LazyClientKeyIdentityProvider(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting)
-
-
Method Details
-
getClientIdentityLoader
- Specified by:
getClientIdentityLoader
in interfaceClientIdentityLoaderHolder
- Returns:
- The
ClientIdentityLoader
to use in order to load client key pair identities - nevernull
-
getLocations
-
getFilePasswordProvider
- Specified by:
getFilePasswordProvider
in interfaceFilePasswordProviderHolder
- Returns:
- The
FilePasswordProvider
to use if need to load encrypted identities keys - nevernull
- See Also:
-
isIgnoreNonExisting
public boolean isIgnoreNonExisting() -
loadKeys
public Iterable<KeyPair> loadKeys(SessionContext session) throws IOException, GeneralSecurityException 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
- Throws:
IOException
- If failed to read/parse the keys dataGeneralSecurityException
- If failed to generate the keys
-
loadClientIdentities
protected Iterable<KeyPair> loadClientIdentities(SessionContext session, NamedResource location) throws IOException, GeneralSecurityException - Throws:
IOException
GeneralSecurityException
-