Interface ClientIdentityLoader
-
public interface ClientIdentityLoader
-
-
Field Summary
Fields Modifier and Type Field Description static ClientIdentityLoader
DEFAULT
A 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 KeyIdentityProvider
asKeyIdentityProvider(ClientIdentityLoader loader, java.util.Collection<? extends NamedResource> locations, FilePasswordProvider passwordProvider, boolean ignoreNonExisting)
Uses the providedClientIdentityLoader
to lazy load the keys locationsboolean
isValidLocation(NamedResource location)
java.lang.Iterable<java.security.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 java.io.IOException
- 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:
java.io.IOException
- If failed to validate the location
-
loadClientIdentities
java.lang.Iterable<java.security.KeyPair> loadClientIdentities(SessionContext session, NamedResource location, FilePasswordProvider provider) throws java.io.IOException, java.security.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:
java.io.IOException
- If failed to access / process the remote locationjava.security.GeneralSecurityException
- If failed to convert the contents into a valid identity
-
asKeyIdentityProvider
static KeyIdentityProvider asKeyIdentityProvider(ClientIdentityLoader loader, java.util.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
-
-