de.mud.jta.plugin
Class SSH

java.lang.Object
  |
  +--de.mud.jta.Plugin
        |
        +--de.mud.jta.plugin.SSH
All Implemented Interfaces:
FilterPlugin

public class SSH
extends Plugin
implements FilterPlugin

Secure Shell plugin for the Java Telnet Application. This is a plugin to be used instead of Telnet for secure remote terminal sessions over insecure networks. The implementation uses code that was derived from Cedric Gourio's implementation that used parts of the old Java Telnet Applet. Have a look at the package de.mud.ssh for further information about ssh or look at the official ssh homepage: http://www.ssh.fi/.

Maintainer: Matthias L. Jugel

Version:
$Id: SSH.java,v 1.16 2002/01/23 09:26:44 leo Exp $
Author:
Matthias L. Jugel, Marcus Meißner

Field Summary
protected  SshIO handler
           
protected  java.lang.String pass
           
protected  FilterPlugin source
           
protected  java.lang.String user
           
 
Fields inherited from class de.mud.jta.Plugin
bus, id
 
Constructor Summary
SSH(PluginBus bus, java.lang.String id)
          Create a new ssh plugin.
 
Method Summary
 int read(byte[] b)
          Read data from the backend and decrypt it.
 void setFilterSource(FilterPlugin source)
          Set the source plugin where we get our data from and where the data sink (write) is.
 void write(byte[] b)
          Write data to the back end.
 
Methods inherited from class de.mud.jta.Plugin
error
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

source

protected FilterPlugin source

handler

protected SshIO handler

user

protected java.lang.String user

pass

protected java.lang.String pass
Constructor Detail

SSH

public SSH(PluginBus bus,
           java.lang.String id)
Create a new ssh plugin.
Method Detail

setFilterSource

public void setFilterSource(FilterPlugin source)
Description copied from interface: FilterPlugin
Set the source plugin where we get our data from and where the data sink (write) is. The actual data handling should be done in the read() and write() methods.
Specified by:
setFilterSource in interface FilterPlugin
Following copied from interface: de.mud.jta.FilterPlugin
Parameters:
source - the data source

read

public int read(byte[] b)
         throws java.io.IOException
Read data from the backend and decrypt it. This is a buffering read as the encrypted information is usually smaller than its decrypted pendant. So it will not read from the backend as long as there is data in the buffer.
Specified by:
read in interface FilterPlugin
Parameters:
b - the buffer where to read the decrypted data in
Returns:
the amount of bytes actually read.

write

public void write(byte[] b)
           throws java.io.IOException
Write data to the back end. This hands the data over to the ssh protocol handler who encrypts the information and writes it to the actual back end pipe.
Specified by:
write in interface FilterPlugin
Parameters:
b - the unencrypted data to be encrypted and sent