Package com.sshtools.j2ssh.transport
Class TransportProtocolClient
java.lang.Object
com.sshtools.j2ssh.transport.TransportProtocolCommon
com.sshtools.j2ssh.transport.TransportProtocolClient
- All Implemented Interfaces:
TransportProtocol
,Runnable
- Version:
- $Revision: 1.49 $
- Author:
- $author$
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionCreates a new TransportProtocolClient object. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
protected String
protected String
protected SshMsgKexInit
protected String
protected String
protected SshMsgKexInit
protected void
void
protected void
protected void
void
void
requestService
(Service service) protected void
protected void
protected void
setRemoteIdent
(String ident) protected void
protected void
setupNewKeys
(byte[] encryptCSKey, byte[] encryptCSIV, byte[] encryptSCKey, byte[] encryptSCIV, byte[] macCSKey, byte[] macSCKey) protected boolean
verifyHostKey
(byte[] key, byte[] sig, byte[] sigdata) 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, isConnected, onCorruptMac, processMessages, readMessage, removeMessageStore, run, sendDisconnect, sendDisconnect, sendKeyExchangeInit, sendMessage, sendNewKeys, setKexTimeout, setKexTransferLimit, setSendIgnore, startBinaryPacketProtocol, startTransportProtocol, stop, unregisterMessage
-
Field Details
-
pk
-
-
Constructor Details
-
TransportProtocolClient
Creates a new TransportProtocolClient object.- Parameters:
hosts
-- Throws:
TransportProtocolException
-
-
Method Details
-
onMessageReceived
- Specified by:
onMessageReceived
in classTransportProtocolCommon
- Parameters:
msg
-- Throws:
IOException
-
registerTransportMessages
- Specified by:
registerTransportMessages
in classTransportProtocolCommon
- Throws:
MessageAlreadyRegisteredException
-
requestService
- Parameters:
service
-- Throws:
IOException
SshException
-
onDisconnect
protected void onDisconnect()- Specified by:
onDisconnect
in classTransportProtocolCommon
-
getDecryptionAlgorithm
- Specified by:
getDecryptionAlgorithm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
getEncryptionAlgorithm
- Specified by:
getEncryptionAlgorithm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
getInputStreamCompAlgortihm
- Specified by:
getInputStreamCompAlgortihm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
getInputStreamMacAlgorithm
- Specified by:
getInputStreamMacAlgorithm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
setLocalIdent
protected void setLocalIdent()- Specified by:
setLocalIdent
in classTransportProtocolCommon
-
getLocalId
- Specified by:
getLocalId
in classTransportProtocolCommon
- Returns:
-
setLocalKexInit
- Specified by:
setLocalKexInit
in classTransportProtocolCommon
- Parameters:
msg
-
-
getLocalKexInit
- Specified by:
getLocalKexInit
in classTransportProtocolCommon
- Returns:
-
getOutputStreamCompAlgorithm
- Specified by:
getOutputStreamCompAlgorithm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
getOutputStreamMacAlgorithm
- Specified by:
getOutputStreamMacAlgorithm
in classTransportProtocolCommon
- Returns:
- Throws:
AlgorithmNotAgreedException
-
setRemoteIdent
- Specified by:
setRemoteIdent
in classTransportProtocolCommon
- Parameters:
ident
-
-
getRemoteId
- Specified by:
getRemoteId
in classTransportProtocolCommon
- Returns:
-
setRemoteKexInit
- Specified by:
setRemoteKexInit
in classTransportProtocolCommon
- Parameters:
msg
-
-
getRemoteKexInit
- Specified by:
getRemoteKexInit
in classTransportProtocolCommon
- Returns:
-
getServerHostKey
- Returns:
-
onStartTransportProtocol
- Specified by:
onStartTransportProtocol
in classTransportProtocolCommon
- Throws:
IOException
TransportProtocolException
-
performKeyExchange
- Specified by:
performKeyExchange
in classTransportProtocolCommon
- Parameters:
kex
-- Throws:
IOException
KeyExchangeException
-
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 classTransportProtocolCommon
- Parameters:
encryptCSKey
-encryptCSIV
-encryptSCKey
-encryptSCIV
-macCSKey
-macSCKey
-- Throws:
AlgorithmNotAgreedException
AlgorithmOperationException
AlgorithmNotSupportedException
AlgorithmInitializationException
-
verifyHostKey
protected boolean verifyHostKey(byte[] key, byte[] sig, byte[] sigdata) throws TransportProtocolException - Parameters:
key
-sig
-sigdata
-- Returns:
- Throws:
TransportProtocolException
-