com.sshtools.daemon.transport
Class TransportProtocolServer

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

public class TransportProtocolServer
extends TransportProtocolCommon

Version:
$Revision: 1.12 $
Author:
$author$

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

Constructor Detail

TransportProtocolServer

public TransportProtocolServer()
                        throws java.io.IOException
Creates a new TransportProtocolServer object.

Throws:
java.io.IOException

TransportProtocolServer

public TransportProtocolServer(boolean refuse)
                        throws java.io.IOException
Creates a new TransportProtocolServer object.

Parameters:
refuse -
Throws:
java.io.IOException
Method Detail

onDisconnect

protected void onDisconnect()
Specified by:
onDisconnect in class TransportProtocolCommon

acceptService

public void acceptService(Service service)
                   throws java.io.IOException
Parameters:
service -
Throws:
java.io.IOException

refuseConnection

public void refuseConnection()
                      throws java.io.IOException
Throws:
java.io.IOException

registerTransportMessages

public void registerTransportMessages()
                               throws MessageAlreadyRegisteredException
Specified by:
registerTransportMessages in class TransportProtocolCommon
Throws:
MessageAlreadyRegisteredException

startBinaryPacketProtocol

protected void startBinaryPacketProtocol()
                                  throws java.io.IOException
Overrides:
startBinaryPacketProtocol in class TransportProtocolCommon
Throws:
java.io.IOException

getDecryptionAlgorithm

protected java.lang.String getDecryptionAlgorithm()
                                           throws AlgorithmNotAgreedException
Specified by:
getDecryptionAlgorithm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

getEncryptionAlgorithm

protected java.lang.String getEncryptionAlgorithm()
                                           throws AlgorithmNotAgreedException
Specified by:
getEncryptionAlgorithm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

getInputStreamCompAlgortihm

protected java.lang.String getInputStreamCompAlgortihm()
                                                throws AlgorithmNotAgreedException
Specified by:
getInputStreamCompAlgortihm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

getInputStreamMacAlgorithm

protected java.lang.String getInputStreamMacAlgorithm()
                                               throws AlgorithmNotAgreedException
Specified by:
getInputStreamMacAlgorithm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

setLocalIdent

protected void setLocalIdent()
Specified by:
setLocalIdent in class TransportProtocolCommon

getLocalId

public java.lang.String getLocalId()
Specified by:
getLocalId in class TransportProtocolCommon
Returns:

setLocalKexInit

protected void setLocalKexInit(SshMsgKexInit msg)
Specified by:
setLocalKexInit in class TransportProtocolCommon
Parameters:
msg -

getLocalKexInit

protected SshMsgKexInit getLocalKexInit()
Specified by:
getLocalKexInit in class TransportProtocolCommon
Returns:

getOutputStreamCompAlgorithm

protected java.lang.String getOutputStreamCompAlgorithm()
                                                 throws AlgorithmNotAgreedException
Specified by:
getOutputStreamCompAlgorithm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

getOutputStreamMacAlgorithm

protected java.lang.String getOutputStreamMacAlgorithm()
                                                throws AlgorithmNotAgreedException
Specified by:
getOutputStreamMacAlgorithm in class TransportProtocolCommon
Returns:
Throws:
AlgorithmNotAgreedException

setRemoteIdent

protected void setRemoteIdent(java.lang.String ident)
Specified by:
setRemoteIdent in class TransportProtocolCommon
Parameters:
ident -

getRemoteId

public java.lang.String getRemoteId()
Specified by:
getRemoteId in class TransportProtocolCommon
Returns:

setRemoteKexInit

protected void setRemoteKexInit(SshMsgKexInit msg)
Specified by:
setRemoteKexInit in class TransportProtocolCommon
Parameters:
msg -

getRemoteKexInit

protected SshMsgKexInit getRemoteKexInit()
Specified by:
getRemoteKexInit in class TransportProtocolCommon
Returns:

createLocalKexInit

protected SshMsgKexInit createLocalKexInit()
                                    throws java.io.IOException
Overrides:
createLocalKexInit in class TransportProtocolCommon
Returns:
Throws:
java.io.IOException
TransportProtocolException

onStartTransportProtocol

protected void onStartTransportProtocol()
                                 throws java.io.IOException
Specified by:
onStartTransportProtocol in class TransportProtocolCommon
Throws:
java.io.IOException

performKeyExchange

protected void performKeyExchange(SshKeyExchange kex)
                           throws java.io.IOException
Specified by:
performKeyExchange in class TransportProtocolCommon
Parameters:
kex -
Throws:
java.io.IOException
KeyExchangeException

onMessageReceived

protected void onMessageReceived(SshMessage msg)
                          throws java.io.IOException
Specified by:
onMessageReceived in class TransportProtocolCommon
Parameters:
msg -
Throws:
java.io.IOException

setupNewKeys

protected void setupNewKeys(byte[] encryptCSKey,
                            byte[] encryptCSIV,
                            byte[] encryptSCKey,
                            byte[] encryptSCIV,
                            byte[] macCSKey,
                            byte[] macSCKey)
                     throws AlgorithmNotAgreedException,
                            AlgorithmOperationException,
                            AlgorithmNotSupportedException,
                            AlgorithmInitializationException
Specified by:
setupNewKeys in class TransportProtocolCommon
Parameters:
encryptCSKey -
encryptCSIV -
encryptSCKey -
encryptSCIV -
macCSKey -
macSCKey -
Throws:
AlgorithmNotAgreedException
AlgorithmOperationException
AlgorithmNotSupportedException
AlgorithmInitializationException


Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.