com.sshtools.j2ssh.transport
Class TransportProtocolClient

java.lang.Object
  extended by com.sshtools.j2ssh.transport.TransportProtocolCommon
      extended by com.sshtools.j2ssh.transport.TransportProtocolClient
All Implemented Interfaces:
com.sshtools.j2ssh.transport.TransportProtocol, Runnable

public class TransportProtocolClient
extends TransportProtocolCommon

DOCUMENT ME!

Version:
$Revision: 1.1 $
Author:
$author$

Field Summary
protected  com.sshtools.j2ssh.transport.publickey.SshPublicKey pk
          DOCUMENT ME!
 
Fields inherited from class com.sshtools.j2ssh.transport.TransportProtocolCommon
algorithmsIn, algorithmsOut, clientIdent, clientKexInit, completeOnNewKeys, EOL_CRLF, EOL_LF, hostKey, k, kexs, log, messageStore, properties, PROTOCOL_VERSION, serverIdent, serverKexInit, sessionIdentifier, signature, SOFTWARE_VERSION_COMMENTS, sshIn, sshOut, state
 
Constructor Summary
TransportProtocolClient(com.sshtools.j2ssh.transport.HostKeyVerification hosts)
          Creates a new TransportProtocolClient object.
 
Method Summary
protected  String getDecryptionAlgorithm()
          DOCUMENT ME!
protected  String getEncryptionAlgorithm()
          DOCUMENT ME!
protected  String getInputStreamCompAlgortihm()
          DOCUMENT ME!
protected  String getInputStreamMacAlgorithm()
          DOCUMENT ME!
 String getLocalId()
          DOCUMENT ME!
protected  com.sshtools.j2ssh.transport.SshMsgKexInit getLocalKexInit()
          DOCUMENT ME!
protected  String getOutputStreamCompAlgorithm()
          DOCUMENT ME!
protected  String getOutputStreamMacAlgorithm()
          DOCUMENT ME!
 String getRemoteId()
          DOCUMENT ME!
protected  com.sshtools.j2ssh.transport.SshMsgKexInit getRemoteKexInit()
          DOCUMENT ME!
 com.sshtools.j2ssh.transport.publickey.SshPublicKey getServerHostKey()
          DOCUMENT ME!
protected  void onDisconnect()
          DOCUMENT ME!
 void onMessageReceived(com.sshtools.j2ssh.transport.SshMessage msg)
          DOCUMENT ME!
protected  void onStartTransportProtocol()
          DOCUMENT ME!
protected  void performKeyExchange(com.sshtools.j2ssh.transport.kex.SshKeyExchange kex)
          DOCUMENT ME!
 void registerTransportMessages()
          DOCUMENT ME!
 void requestService(com.sshtools.j2ssh.transport.Service service)
          DOCUMENT ME!
protected  void setLocalIdent()
          DOCUMENT ME!
protected  void setLocalKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
          DOCUMENT ME!
protected  void setRemoteIdent(String ident)
          DOCUMENT ME!
protected  void setRemoteKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
          DOCUMENT ME!
protected  void setupNewKeys(byte[] encryptCSKey, byte[] encryptCSIV, byte[] encryptSCKey, byte[] encryptSCIV, byte[] macCSKey, byte[] macSCKey)
          DOCUMENT ME!
protected  boolean verifyHostKey(byte[] key, byte[] sig, byte[] sigdata)
          DOCUMENT ME!
 
Methods inherited from class com.sshtools.j2ssh.transport.TransportProtocolCommon
addEventHandler, addMessageStore, beginKeyExchange, completeKeyExchange, createLocalKexInit, determineAlgorithm, disconnect, getConnectionId, getEventHandlers, getIncomingByteCount, getKexAlgorithm, getOutgoingByteCount, getProperties, getRemoteEOL, getSessionIdentifier, getState, getUnderlyingProviderDetail, onCorruptMac, processMessages, readMessage, removeMessageStore, run, sendDisconnect, sendDisconnect, sendKeyExchangeInit, sendMessage, sendNewKeys, setKexTimeout, setKexTransferLimit, setSendIgnore, startBinaryPacketProtocol, startTransportProtocol, stop, unregisterMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pk

protected com.sshtools.j2ssh.transport.publickey.SshPublicKey pk
DOCUMENT ME!

Constructor Detail

TransportProtocolClient

public TransportProtocolClient(com.sshtools.j2ssh.transport.HostKeyVerification hosts)
                        throws com.sshtools.j2ssh.transport.TransportProtocolException
Creates a new TransportProtocolClient object.

Parameters:
hosts - DOCUMENT ME!
Throws:
TransportProtocolException - DOCUMENT ME!
Method Detail

onMessageReceived

public void onMessageReceived(com.sshtools.j2ssh.transport.SshMessage msg)
                       throws IOException
DOCUMENT ME!

Specified by:
onMessageReceived in class TransportProtocolCommon
Parameters:
msg - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!

registerTransportMessages

public void registerTransportMessages()
                               throws com.sshtools.j2ssh.transport.MessageAlreadyRegisteredException
DOCUMENT ME!

Specified by:
registerTransportMessages in class TransportProtocolCommon
Throws:
MessageAlreadyRegisteredException - DOCUMENT ME!

requestService

public void requestService(com.sshtools.j2ssh.transport.Service service)
                    throws IOException
DOCUMENT ME!

Parameters:
service - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
com.sshtools.j2ssh.SshException - DOCUMENT ME!

onDisconnect

protected void onDisconnect()
DOCUMENT ME!

Specified by:
onDisconnect in class TransportProtocolCommon

getDecryptionAlgorithm

protected String getDecryptionAlgorithm()
                                 throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getDecryptionAlgorithm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

getEncryptionAlgorithm

protected String getEncryptionAlgorithm()
                                 throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getEncryptionAlgorithm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

getInputStreamCompAlgortihm

protected String getInputStreamCompAlgortihm()
                                      throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getInputStreamCompAlgortihm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

getInputStreamMacAlgorithm

protected String getInputStreamMacAlgorithm()
                                     throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getInputStreamMacAlgorithm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

setLocalIdent

protected void setLocalIdent()
DOCUMENT ME!

Specified by:
setLocalIdent in class TransportProtocolCommon

getLocalId

public String getLocalId()
DOCUMENT ME!

Specified by:
getLocalId in class TransportProtocolCommon
Returns:
DOCUMENT ME!

setLocalKexInit

protected void setLocalKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
DOCUMENT ME!

Specified by:
setLocalKexInit in class TransportProtocolCommon
Parameters:
msg - DOCUMENT ME!

getLocalKexInit

protected com.sshtools.j2ssh.transport.SshMsgKexInit getLocalKexInit()
DOCUMENT ME!

Specified by:
getLocalKexInit in class TransportProtocolCommon
Returns:
DOCUMENT ME!

getOutputStreamCompAlgorithm

protected String getOutputStreamCompAlgorithm()
                                       throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getOutputStreamCompAlgorithm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

getOutputStreamMacAlgorithm

protected String getOutputStreamMacAlgorithm()
                                      throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException
DOCUMENT ME!

Specified by:
getOutputStreamMacAlgorithm in class TransportProtocolCommon
Returns:
DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!

setRemoteIdent

protected void setRemoteIdent(String ident)
DOCUMENT ME!

Specified by:
setRemoteIdent in class TransportProtocolCommon
Parameters:
ident - DOCUMENT ME!

getRemoteId

public String getRemoteId()
DOCUMENT ME!

Specified by:
getRemoteId in class TransportProtocolCommon
Returns:
DOCUMENT ME!

setRemoteKexInit

protected void setRemoteKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
DOCUMENT ME!

Specified by:
setRemoteKexInit in class TransportProtocolCommon
Parameters:
msg - DOCUMENT ME!

getRemoteKexInit

protected com.sshtools.j2ssh.transport.SshMsgKexInit getRemoteKexInit()
DOCUMENT ME!

Specified by:
getRemoteKexInit in class TransportProtocolCommon
Returns:
DOCUMENT ME!

getServerHostKey

public com.sshtools.j2ssh.transport.publickey.SshPublicKey getServerHostKey()
DOCUMENT ME!

Returns:
DOCUMENT ME!

onStartTransportProtocol

protected void onStartTransportProtocol()
                                 throws IOException
DOCUMENT ME!

Specified by:
onStartTransportProtocol in class TransportProtocolCommon
Throws:
IOException - DOCUMENT ME!
TransportProtocolException - DOCUMENT ME!

performKeyExchange

protected void performKeyExchange(com.sshtools.j2ssh.transport.kex.SshKeyExchange kex)
                           throws IOException
DOCUMENT ME!

Specified by:
performKeyExchange in class TransportProtocolCommon
Parameters:
kex - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!

setupNewKeys

protected void setupNewKeys(byte[] encryptCSKey,
                            byte[] encryptCSIV,
                            byte[] encryptSCKey,
                            byte[] encryptSCIV,
                            byte[] macCSKey,
                            byte[] macSCKey)
                     throws com.sshtools.j2ssh.transport.AlgorithmNotAgreedException,
                            com.sshtools.j2ssh.transport.AlgorithmOperationException,
                            com.sshtools.j2ssh.transport.AlgorithmNotSupportedException,
                            com.sshtools.j2ssh.transport.AlgorithmInitializationException
DOCUMENT ME!

Specified by:
setupNewKeys in class TransportProtocolCommon
Parameters:
encryptCSKey - DOCUMENT ME!
encryptCSIV - DOCUMENT ME!
encryptSCKey - DOCUMENT ME!
encryptSCIV - DOCUMENT ME!
macCSKey - DOCUMENT ME!
macSCKey - DOCUMENT ME!
Throws:
AlgorithmNotAgreedException - DOCUMENT ME!
AlgorithmOperationException - DOCUMENT ME!
AlgorithmNotSupportedException - DOCUMENT ME!
AlgorithmInitializationException - DOCUMENT ME!

verifyHostKey

protected boolean verifyHostKey(byte[] key,
                                byte[] sig,
                                byte[] sigdata)
                         throws com.sshtools.j2ssh.transport.TransportProtocolException
DOCUMENT ME!

Parameters:
key - DOCUMENT ME!
sig - DOCUMENT ME!
sigdata - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
TransportProtocolException - DOCUMENT ME!