public class PasswordProviderWrapper extends Object implements RepeatingFilePasswordProvider
RepeatingFilePasswordProvider
to our
KeyPasswordProvider
API.RepeatingFilePasswordProvider.ResourceDecodeResult
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.
|
String |
getPassword(String resourceKey) |
RepeatingFilePasswordProvider.ResourceDecodeResult |
handleDecodeAttemptResult(String resourceKey,
String password,
Exception err)
Invoked to inform the password provider about the decoding result.
|
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.
|
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 String getPassword(String resourceKey) throws IOException
getPassword
in interface org.apache.sshd.common.config.keys.FilePasswordProvider
IOException
public RepeatingFilePasswordProvider.ResourceDecodeResult handleDecodeAttemptResult(String resourceKey, String password, Exception err) throws IOException, GeneralSecurityException
RepeatingFilePasswordProvider
handleDecodeAttemptResult
in interface RepeatingFilePasswordProvider
resourceKey
- The resource key representing the private filepassword
- The password that was attemptederr
- The attempt result - null
for successnull
is same as
RepeatingFilePasswordProvider.ResourceDecodeResult.TERMINATE
.IOException
GeneralSecurityException
Copyright © 2018 Eclipse JGit Project. All rights reserved.