public class PasswordProviderWrapper extends java.lang.Object implements RepeatingFilePasswordProvider
RepeatingFilePasswordProvider
to our
KeyPasswordProvider
API.Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger> |
counts |
private KeyPasswordProvider |
delegate |
Constructor and Description |
---|
PasswordProviderWrapper(KeyPasswordProvider delegate) |
Modifier and Type | Method and Description |
---|---|
int |
getAttempts()
Gets the maximum number of attempts to get a password that should be
attempted for one identity resource through this provider.
|
java.lang.String |
getPassword(org.apache.sshd.common.session.SessionContext session,
org.apache.sshd.common.NamedResource resource,
int attemptIndex) |
org.apache.sshd.common.config.keys.FilePasswordProvider.ResourceDecodeResult |
handleDecodeAttemptResult(org.apache.sshd.common.session.SessionContext session,
org.apache.sshd.common.NamedResource resource,
int retryIndex,
java.lang.String password,
java.lang.Exception err) |
void |
setAttempts(int numberOfPasswordPrompts)
Define the maximum number of attempts to get a password that should be
attempted for one identity resource through this provider.
|
private URIish |
toUri(java.lang.String resourceKey)
Creates a
URIish from a given string. |
private final KeyPasswordProvider delegate
private java.util.Map<java.lang.String,java.util.concurrent.atomic.AtomicInteger> counts
public PasswordProviderWrapper(@NonNull KeyPasswordProvider delegate)
delegate
- public void setAttempts(int numberOfPasswordPrompts)
RepeatingFilePasswordProvider
setAttempts
in interface RepeatingFilePasswordProvider
numberOfPasswordPrompts
- number of times to ask for a password;
IllegalArgumentException
may be thrown if <= 0public int getAttempts()
RepeatingFilePasswordProvider
getAttempts
in interface RepeatingFilePasswordProvider
public java.lang.String getPassword(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, int attemptIndex) throws java.io.IOException
getPassword
in interface org.apache.sshd.common.config.keys.FilePasswordProvider
java.io.IOException
public org.apache.sshd.common.config.keys.FilePasswordProvider.ResourceDecodeResult handleDecodeAttemptResult(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, int retryIndex, java.lang.String password, java.lang.Exception err) throws java.io.IOException, java.security.GeneralSecurityException
handleDecodeAttemptResult
in interface org.apache.sshd.common.config.keys.FilePasswordProvider
java.io.IOException
java.security.GeneralSecurityException
private URIish toUri(java.lang.String resourceKey)
URIish
from a given string. The
CredentialsProvider
uses uris as resource identifications.resourceKey
- to convert