Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.sshtools.j2ssh.transport
Class ConsoleKnownHostsKeyVerification  view ConsoleKnownHostsKeyVerification download ConsoleKnownHostsKeyVerification.java

java.lang.Object
  extended bycom.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
      extended bycom.sshtools.j2ssh.transport.ConsoleKnownHostsKeyVerification
All Implemented Interfaces:
HostKeyVerification

public class ConsoleKnownHostsKeyVerification
extends AbstractKnownHostsKeyVerification

Implements the AbstractKnownHostsKeyVerification to provide host key verification through the console.

Since:
0.2.0
Version:
$Revision: 1.14 $

Field Summary
 
Fields inherited from class com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
 
Constructor Summary
ConsoleKnownHostsKeyVerification()
           Constructs the verification instance with the default known_hosts file from $HOME/.ssh/known_hosts.
ConsoleKnownHostsKeyVerification(java.lang.String knownhosts)
           Constructs the verification instance with the specified known_hosts file.
 
Method Summary
private  void getResponse(java.lang.String host, com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
           
 void onHostKeyMismatch(java.lang.String host, com.sshtools.j2ssh.transport.publickey.SshPublicKey pk, com.sshtools.j2ssh.transport.publickey.SshPublicKey actual)
           Prompts the user through the console to verify the host key.
 void onUnknownHost(java.lang.String host, com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
           Prompts the user through the console to verify the host key.
 
Methods inherited from class com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
allowedHosts, allowHost, isHostFileWriteable, removeAllowedHost, saveHostFile, toString, verifyHost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConsoleKnownHostsKeyVerification

public ConsoleKnownHostsKeyVerification()
                                 throws InvalidHostFileException

Constructs the verification instance with the default known_hosts file from $HOME/.ssh/known_hosts.

Since:
0.2.0

ConsoleKnownHostsKeyVerification

public ConsoleKnownHostsKeyVerification(java.lang.String knownhosts)
                                 throws InvalidHostFileException

Constructs the verification instance with the specified known_hosts file.

Since:
0.2.0
Method Detail

onHostKeyMismatch

public void onHostKeyMismatch(java.lang.String host,
                              com.sshtools.j2ssh.transport.publickey.SshPublicKey pk,
                              com.sshtools.j2ssh.transport.publickey.SshPublicKey actual)

Prompts the user through the console to verify the host key.

Specified by:
onHostKeyMismatch in class AbstractKnownHostsKeyVerification
Since:
0.2.0

onUnknownHost

public void onUnknownHost(java.lang.String host,
                          com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)

Prompts the user through the console to verify the host key.

Specified by:
onUnknownHost in class AbstractKnownHostsKeyVerification
Since:
0.2.0

getResponse

private void getResponse(java.lang.String host,
                         com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
                  throws InvalidHostFileException,
                         java.io.IOException