Interface ClientIdentityLoader
public interface ClientIdentityLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClientIdentityLoaderA default implementation that assumes a file location that must exist. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyIdentityProviderasKeyIdentityProvider(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting) Uses the providedClientIdentityLoaderto lazy load the keys locationsbooleanisValidLocation(NamedResource location) loadClientIdentities(SessionContext session, NamedResource location, FilePasswordProvider provider)
-
Field Details
-
DEFAULT
A default implementation that assumes a file location that must exist.
Note: It calls
SecurityUtils.loadKeyPairIdentities(SessionContext, NamedResource, InputStream, FilePasswordProvider)
-
-
Method Details
-
isValidLocation
- 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
-