Package com.sshtools.daemon.transport
Class TransportProtocolServer
- java.lang.Object
-
- com.sshtools.j2ssh.transport.TransportProtocolCommon
-
- 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
Constructors Constructor Description TransportProtocolServer()Creates a new TransportProtocolServer object.TransportProtocolServer(boolean refuse)Creates a new TransportProtocolServer object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacceptService(Service service)protected SshMsgKexInitcreateLocalKexInit()protected java.lang.StringgetDecryptionAlgorithm()protected java.lang.StringgetEncryptionAlgorithm()protected java.lang.StringgetInputStreamCompAlgortihm()protected java.lang.StringgetInputStreamMacAlgorithm()java.lang.StringgetLocalId()protected SshMsgKexInitgetLocalKexInit()protected java.lang.StringgetOutputStreamCompAlgorithm()protected java.lang.StringgetOutputStreamMacAlgorithm()java.lang.StringgetRemoteId()protected SshMsgKexInitgetRemoteKexInit()protected voidonDisconnect()protected voidonMessageReceived(SshMessage msg)protected voidonStartTransportProtocol()protected voidperformKeyExchange(SshKeyExchange kex)voidrefuseConnection()voidregisterTransportMessages()protected voidsetLocalIdent()protected voidsetLocalKexInit(SshMsgKexInit msg)protected voidsetRemoteIdent(java.lang.String ident)protected voidsetRemoteKexInit(SshMsgKexInit msg)protected voidsetupNewKeys(byte[] encryptCSKey, byte[] encryptCSIV, byte[] encryptSCKey, byte[] encryptSCIV, byte[] macCSKey, byte[] macSCKey)protected voidstartBinaryPacketProtocol()-
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
-
-
-
-
Constructor Detail
-
TransportProtocolServer
public TransportProtocolServer() throws java.io.IOExceptionCreates a new TransportProtocolServer object.- Throws:
java.io.IOException
-
TransportProtocolServer
public TransportProtocolServer(boolean refuse) throws java.io.IOExceptionCreates a new TransportProtocolServer object.- Parameters:
refuse-- Throws:
java.io.IOException
-
-
Method Detail
-
onDisconnect
protected void onDisconnect()
- Specified by:
onDisconnectin classTransportProtocolCommon
-
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:
registerTransportMessagesin classTransportProtocolCommon- Throws:
MessageAlreadyRegisteredException
-
startBinaryPacketProtocol
protected void startBinaryPacketProtocol() throws java.io.IOException- Overrides:
startBinaryPacketProtocolin classTransportProtocolCommon- Throws:
java.io.IOException
-
getDecryptionAlgorithm
protected java.lang.String getDecryptionAlgorithm() throws AlgorithmNotAgreedException- Specified by:
getDecryptionAlgorithmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
getEncryptionAlgorithm
protected java.lang.String getEncryptionAlgorithm() throws AlgorithmNotAgreedException- Specified by:
getEncryptionAlgorithmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
getInputStreamCompAlgortihm
protected java.lang.String getInputStreamCompAlgortihm() throws AlgorithmNotAgreedException- Specified by:
getInputStreamCompAlgortihmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
getInputStreamMacAlgorithm
protected java.lang.String getInputStreamMacAlgorithm() throws AlgorithmNotAgreedException- Specified by:
getInputStreamMacAlgorithmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
setLocalIdent
protected void setLocalIdent()
- Specified by:
setLocalIdentin classTransportProtocolCommon
-
getLocalId
public java.lang.String getLocalId()
- Specified by:
getLocalIdin classTransportProtocolCommon- Returns:
-
setLocalKexInit
protected void setLocalKexInit(SshMsgKexInit msg)
- Specified by:
setLocalKexInitin classTransportProtocolCommon- Parameters:
msg-
-
getLocalKexInit
protected SshMsgKexInit getLocalKexInit()
- Specified by:
getLocalKexInitin classTransportProtocolCommon- Returns:
-
getOutputStreamCompAlgorithm
protected java.lang.String getOutputStreamCompAlgorithm() throws AlgorithmNotAgreedException- Specified by:
getOutputStreamCompAlgorithmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
getOutputStreamMacAlgorithm
protected java.lang.String getOutputStreamMacAlgorithm() throws AlgorithmNotAgreedException- Specified by:
getOutputStreamMacAlgorithmin classTransportProtocolCommon- Returns:
- Throws:
AlgorithmNotAgreedException
-
setRemoteIdent
protected void setRemoteIdent(java.lang.String ident)
- Specified by:
setRemoteIdentin classTransportProtocolCommon- Parameters:
ident-
-
getRemoteId
public java.lang.String getRemoteId()
- Specified by:
getRemoteIdin classTransportProtocolCommon- Returns:
-
setRemoteKexInit
protected void setRemoteKexInit(SshMsgKexInit msg)
- Specified by:
setRemoteKexInitin classTransportProtocolCommon- Parameters:
msg-
-
getRemoteKexInit
protected SshMsgKexInit getRemoteKexInit()
- Specified by:
getRemoteKexInitin classTransportProtocolCommon- Returns:
-
createLocalKexInit
protected SshMsgKexInit createLocalKexInit() throws java.io.IOException
- Overrides:
createLocalKexInitin classTransportProtocolCommon- Returns:
- Throws:
java.io.IOExceptionTransportProtocolException
-
onStartTransportProtocol
protected void onStartTransportProtocol() throws java.io.IOException- Specified by:
onStartTransportProtocolin classTransportProtocolCommon- Throws:
java.io.IOException
-
performKeyExchange
protected void performKeyExchange(SshKeyExchange kex) throws java.io.IOException
- Specified by:
performKeyExchangein classTransportProtocolCommon- Parameters:
kex-- Throws:
java.io.IOExceptionKeyExchangeException
-
onMessageReceived
protected void onMessageReceived(SshMessage msg) throws java.io.IOException
- Specified by:
onMessageReceivedin classTransportProtocolCommon- 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:
setupNewKeysin classTransportProtocolCommon- Parameters:
encryptCSKey-encryptCSIV-encryptSCKey-encryptSCIV-macCSKey-macSCKey-- Throws:
AlgorithmNotAgreedExceptionAlgorithmOperationExceptionAlgorithmNotSupportedExceptionAlgorithmInitializationException
-
-