@FunctionalInterface public interface FilePasswordProvider
Modifier and Type | Interface and Description |
---|---|
static class |
FilePasswordProvider.ResourceDecodeResult |
Modifier and Type | Field and Description |
---|---|
static FilePasswordProvider |
EMPTY
An "empty" provider that returns
null - i.e., unprotected key file |
Modifier and Type | Method and Description |
---|---|
String |
getPassword(SessionContext session,
NamedResource resourceKey,
int retryIndex) |
default FilePasswordProvider.ResourceDecodeResult |
handleDecodeAttemptResult(SessionContext session,
NamedResource resourceKey,
int retryIndex,
String password,
Exception err)
Invoked to inform the password provide about the decoding result.
|
static FilePasswordProvider |
of(String password) |
static final FilePasswordProvider EMPTY
null
- i.e., unprotected key fileString getPassword(SessionContext session, NamedResource resourceKey, int retryIndex) throws IOException
session
- The SessionContext
for invoking this load command - may be null
if not
invoked within a session context (e.g., offline tool or session unknown).resourceKey
- The resource key representing the private fileretryIndex
- The zero-based index of the invocation for the specific resource (in case invoked several
times for the same resource)null
/empty then no password is requiredIOException
- if cannot resolve passwordhandleDecodeAttemptResult(SessionContext, NamedResource, int, String, Exception)
default FilePasswordProvider.ResourceDecodeResult handleDecodeAttemptResult(SessionContext session, NamedResource resourceKey, int retryIndex, String password, Exception err) throws IOException, GeneralSecurityException
session
- The SessionContext
for invoking this load command - may be null
if not invoked within a session context (e.g., offline tool or session unknown).resourceKey
- The resource key representing the private fileretryIndex
- The zero-based index of the invocation for the specific resource (in case
invoked several times for the same resource). If success report, it indicates
the number of retries it took to succeedpassword
- The password that was attemptederr
- The attempt result - null
for successnull
is same as
FilePasswordProvider.ResourceDecodeResult.TERMINATE
.IOException
- If cannot resolve a new passwordGeneralSecurityException
- If not attempting to resolve a new passwordstatic FilePasswordProvider of(String password)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.