com.maverick.ssh1
Class Ssh1ChallengeResponseAuthentication
java.lang.Object
com.maverick.ssh1.Ssh1ChallengeResponseAuthentication
- All Implemented Interfaces:
- SshAuthentication
- public class Ssh1ChallengeResponseAuthentication
- extends java.lang.Object
- implements SshAuthentication
Adds support for SSH1 challenge response authentication. Simply set
the prompt interface on the instance so that a callback is available
for the user to provide their response to the challenge.
Ssh1ChallengeResponseAuthentication auth = new Ssh1ChallengeResponseAuthentication();
auth.setPrompt(new Ssh1ChallengeResponseAuthentication.Prompt() {
public String getResponse(String challenge) {
try {
System.out.print(challenge + ": ");
return reader.readLine();
} catch (IOException ex) {
return null;
}
}
});
ssh.authenticate(auth);
- Author:
- Lee David Painter
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Ssh1ChallengeResponseAuthentication
public Ssh1ChallengeResponseAuthentication()
getMethod
public java.lang.String getMethod()
- Description copied from interface:
SshAuthentication
- The SSH authentication method name
- Specified by:
getMethod
in interface SshAuthentication
- Returns:
- String
getUsername
public java.lang.String getUsername()
- Get the username for this authentication attempt.
- Specified by:
getUsername
in interface SshAuthentication
- Returns:
- the username used.
setUsername
public void setUsername(java.lang.String username)
- Set the username for this authentication attempt.
- Specified by:
setUsername
in interface SshAuthentication
- Parameters:
username
- String
setPrompt
public void setPrompt(Ssh1ChallengeResponseAuthentication.Prompt prompt)
getPrompt
public Ssh1ChallengeResponseAuthentication.Prompt getPrompt()
Copyright © 2003 3SP LTD. All Rights Reserved.