Interface ClientIdentityLoader
public interface ClientIdentityLoader
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ClientIdentityLoader
A default implementation that assumes a file location that must exist. -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyIdentityProvider
asKeyIdentityProvider
(ClientIdentityLoader loader, Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting) Uses the providedClientIdentityLoader
to lazy load the keys locationsboolean
isValidLocation
(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:
true
if 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
- TheSessionContext
for invoking this load command - may benull
if 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
- TheFilePasswordProvider
to consult if the location contains an encrypted identity- Returns:
- The loaded
KeyPair
-null
if 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 providedClientIdentityLoader
to lazy load the keys locations- Parameters:
loader
- The loader instance to uselocations
- The locations to load - ignored ifnull
/emptypasswordProvider
- TheFilePasswordProvider
to use if any encrypted keys foundignoreNonExisting
- Whether to ignore non existing locations as indicated byisValidLocation(NamedResource)
- Returns:
- The
KeyIdentityProvider
wrapper
-