Interface ClientIdentityLoader
-
public interface ClientIdentityLoader- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static ClientIdentityLoaderDEFAULTA default implementation that assumes a file location that must exist.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static KeyIdentityProviderasKeyIdentityProvider(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting)Uses the providedClientIdentityLoaderto lazy load the keys locationsbooleanisValidLocation(NamedResource location)Iterable<KeyPair>loadClientIdentities(SessionContext session, NamedResource location, FilePasswordProvider provider)
-
-
-
Field Detail
-
DEFAULT
static final ClientIdentityLoader DEFAULT
A default implementation that assumes a file location that must exist.
Note: It calls
SecurityUtils.loadKeyPairIdentities(SessionContext, NamedResource, InputStream, FilePasswordProvider)
-
-
Method Detail
-
isValidLocation
boolean isValidLocation(NamedResource location) throws IOException
- Parameters:
location- The identity key-pair location - the actual meaning (file, URL, etc.) depends on the implementation.- Returns:
trueif it represents a valid location - the actual meaning of the validity depends on the implementation- Throws:
IOException- If failed to validate the location
-
loadClientIdentities
Iterable<KeyPair> loadClientIdentities(SessionContext session, NamedResource location, FilePasswordProvider provider) throws IOException, GeneralSecurityException
- Parameters:
session- TheSessionContextfor invoking this load command - may benullif not invoked within a session context (e.g., offline tool).location- The identity key-pair location - the actual meaning (file, URL, etc.) depends on the implementation.provider- TheFilePasswordProviderto consult if the location contains an encrypted identity- Returns:
- The loaded
KeyPair-nullif location is empty and it is OK that it does not exist - Throws:
IOException- If failed to access / process the remote locationGeneralSecurityException- If failed to convert the contents into a valid identity
-
asKeyIdentityProvider
static KeyIdentityProvider asKeyIdentityProvider(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting)
Uses the providedClientIdentityLoaderto lazy load the keys locations- Parameters:
loader- The loader instance to uselocations- The locations to load - ignored ifnull/emptypasswordProvider- TheFilePasswordProviderto use if any encrypted keys foundignoreNonExisting- Whether to ignore non existing locations as indicated byisValidLocation(NamedResource)- Returns:
- The
KeyIdentityProviderwrapper
-
-