com.maverick.ssh1
Class Ssh1ChallengeResponseAuthentication

java.lang.Object
  extended bycom.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

Nested Class Summary
static interface Ssh1ChallengeResponseAuthentication.Prompt
           
 
Field Summary
 
Fields inherited from interface com.maverick.ssh.SshAuthentication
CANCELLED, COMPLETE, FAILED, FURTHER_AUTHENTICATION_REQUIRED, PUBLIC_KEY_ACCEPTABLE
 
Constructor Summary
Ssh1ChallengeResponseAuthentication()
           
 
Method Summary
 java.lang.String getMethod()
          The SSH authentication method name
 Ssh1ChallengeResponseAuthentication.Prompt getPrompt()
           
 java.lang.String getUsername()
          Get the username for this authentication attempt.
 void setPrompt(Ssh1ChallengeResponseAuthentication.Prompt prompt)
           
 void setUsername(java.lang.String username)
          Set the username for this authentication attempt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Ssh1ChallengeResponseAuthentication

public Ssh1ChallengeResponseAuthentication()
Method Detail

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.