Class PasswordProviderWrapper
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.PasswordProviderWrapper
-
- All Implemented Interfaces:
org.apache.sshd.common.config.keys.FilePasswordProvider
,RepeatingFilePasswordProvider
public class PasswordProviderWrapper extends Object implements RepeatingFilePasswordProvider
A bridge from sshd'sRepeatingFilePasswordProvider
to ourKeyPasswordProvider
API.
-
-
Constructor Summary
Constructors Constructor Description PasswordProviderWrapper(KeyPasswordProvider delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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(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, String password, 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.
-
-
-
Constructor Detail
-
PasswordProviderWrapper
public PasswordProviderWrapper(@NonNull KeyPasswordProvider delegate)
- Parameters:
delegate
-
-
-
Method Detail
-
setAttempts
public void setAttempts(int numberOfPasswordPrompts)
Description copied from interface:RepeatingFilePasswordProvider
Define the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.- Specified by:
setAttempts
in interfaceRepeatingFilePasswordProvider
- Parameters:
numberOfPasswordPrompts
- number of times to ask for a password;IllegalArgumentException
may be thrown if <= 0
-
getAttempts
public int getAttempts()
Description copied from interface:RepeatingFilePasswordProvider
Gets the maximum number of attempts to get a password that should be attempted for one identity resource through this provider.- Specified by:
getAttempts
in interfaceRepeatingFilePasswordProvider
- Returns:
- the maximum number of attempts to try, always >= 1.
-
getPassword
public String getPassword(org.apache.sshd.common.session.SessionContext session, org.apache.sshd.common.NamedResource resource, int attemptIndex) throws IOException
- Specified by:
getPassword
in interfaceorg.apache.sshd.common.config.keys.FilePasswordProvider
- Throws:
IOException
-
handleDecodeAttemptResult
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, String password, Exception err) throws IOException, GeneralSecurityException
- Specified by:
handleDecodeAttemptResult
in interfaceorg.apache.sshd.common.config.keys.FilePasswordProvider
- Throws:
IOException
GeneralSecurityException
-
-