com.sshtools.j2ssh.transport

Class TransportProtocolClient

Implemented Interfaces:
Runnable, TransportProtocol

public class TransportProtocolClient
extends TransportProtocolCommon

Version:
$Revision: 1.49 $
Author:
$author$

Field Summary

protected SshPublicKey
pk

Fields inherited from class com.sshtools.j2ssh.transport.TransportProtocolCommon

EOL_CRLF, EOL_LF, PROTOCOL_VERSION, SOFTWARE_VERSION_COMMENTS, algorithmsIn, algorithmsOut, clientIdent, clientKexInit, completeOnNewKeys, hostKey, hosts, k, kexs, log, messageStore, properties, serverIdent, serverKexInit, sessionIdentifier, signature, sshIn, sshOut, state

Constructor Summary

TransportProtocolClient(HostKeyVerification hosts)
Creates a new TransportProtocolClient object.

Method Summary

protected String
getDecryptionAlgorithm()
protected String
getEncryptionAlgorithm()
protected String
getInputStreamCompAlgortihm()
protected String
getInputStreamMacAlgorithm()
String
getLocalId()
protected SshMsgKexInit
getLocalKexInit()
protected String
getOutputStreamCompAlgorithm()
protected String
getOutputStreamMacAlgorithm()
String
getRemoteId()
protected SshMsgKexInit
getRemoteKexInit()
SshPublicKey
getServerHostKey()
protected void
onDisconnect()
void
onMessageReceived(SshMessage msg)
protected void
onStartTransportProtocol()
protected void
performKeyExchange(SshKeyExchange kex)
void
registerTransportMessages()
void
requestService(Service service)
protected void
setLocalIdent()
protected void
setLocalKexInit(SshMsgKexInit msg)
protected void
setRemoteIdent(String ident)
protected void
setRemoteKexInit(SshMsgKexInit msg)
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, getDecryptionAlgorithm, getEncryptionAlgorithm, getEventHandlers, getIncomingByteCount, getInputStreamCompAlgortihm, getInputStreamMacAlgorithm, getKexAlgorithm, getLocalId, getLocalKexInit, getOutgoingByteCount, getOutputStreamCompAlgorithm, getOutputStreamMacAlgorithm, getProperties, getRemoteEOL, getRemoteId, getRemoteKexInit, getSessionIdentifier, getState, getUnderlyingProviderDetail, isConnected, onCorruptMac, onDisconnect, onMessageReceived, onStartTransportProtocol, performKeyExchange, processMessages, readMessage, registerTransportMessages, removeMessageStore, run, sendDisconnect, sendDisconnect, sendKeyExchangeInit, sendMessage, sendNewKeys, setKexTimeout, setKexTransferLimit, setLocalIdent, setLocalKexInit, setRemoteIdent, setRemoteKexInit, setSendIgnore, setupNewKeys, startBinaryPacketProtocol, startTransportProtocol, stop, unregisterMessage

Field Details

pk

protected SshPublicKey pk

Constructor Details

TransportProtocolClient

public TransportProtocolClient(HostKeyVerification hosts)
            throws TransportProtocolException
Creates a new TransportProtocolClient object.
Parameters:
hosts -

Method Details

getDecryptionAlgorithm

protected String getDecryptionAlgorithm()
            throws AlgorithmNotAgreedException
Overrides:
getDecryptionAlgorithm in interface TransportProtocolCommon
Returns:

getEncryptionAlgorithm

protected String getEncryptionAlgorithm()
            throws AlgorithmNotAgreedException
Overrides:
getEncryptionAlgorithm in interface TransportProtocolCommon
Returns:

getInputStreamCompAlgortihm

protected String getInputStreamCompAlgortihm()
            throws AlgorithmNotAgreedException
Overrides:
getInputStreamCompAlgortihm in interface TransportProtocolCommon
Returns:

getInputStreamMacAlgorithm

protected String getInputStreamMacAlgorithm()
            throws AlgorithmNotAgreedException
Overrides:
getInputStreamMacAlgorithm in interface TransportProtocolCommon
Returns:

getLocalId

public String getLocalId()
Overrides:
getLocalId in interface TransportProtocolCommon
Returns:

getLocalKexInit

protected SshMsgKexInit getLocalKexInit()
Overrides:
getLocalKexInit in interface TransportProtocolCommon
Returns:

getOutputStreamCompAlgorithm

protected String getOutputStreamCompAlgorithm()
            throws AlgorithmNotAgreedException
Overrides:
getOutputStreamCompAlgorithm in interface TransportProtocolCommon
Returns:

getOutputStreamMacAlgorithm

protected String getOutputStreamMacAlgorithm()
            throws AlgorithmNotAgreedException
Overrides:
getOutputStreamMacAlgorithm in interface TransportProtocolCommon
Returns:

getRemoteId

public String getRemoteId()
Overrides:
getRemoteId in interface TransportProtocolCommon
Returns:

getRemoteKexInit

protected SshMsgKexInit getRemoteKexInit()
Overrides:
getRemoteKexInit in interface TransportProtocolCommon
Returns:

getServerHostKey

public SshPublicKey getServerHostKey()
Returns:

onDisconnect

protected void onDisconnect()
Overrides:
onDisconnect in interface TransportProtocolCommon

onMessageReceived

public void onMessageReceived(SshMessage msg)
            throws IOException
Overrides:
onMessageReceived in interface TransportProtocolCommon
Parameters:
msg -

onStartTransportProtocol

protected void onStartTransportProtocol()
            throws IOException
Overrides:
onStartTransportProtocol in interface TransportProtocolCommon

performKeyExchange

protected void performKeyExchange(SshKeyExchange kex)
            throws IOException
Overrides:
performKeyExchange in interface TransportProtocolCommon
Parameters:
kex -

registerTransportMessages

public void registerTransportMessages()
            throws MessageAlreadyRegisteredException
Overrides:
registerTransportMessages in interface TransportProtocolCommon

requestService

public void requestService(Service service)
            throws IOException
Parameters:
service -

setLocalIdent

protected void setLocalIdent()
Overrides:
setLocalIdent in interface TransportProtocolCommon

setLocalKexInit

protected void setLocalKexInit(SshMsgKexInit msg)
Overrides:
setLocalKexInit in interface TransportProtocolCommon
Parameters:
msg -

setRemoteIdent

protected void setRemoteIdent(String ident)
Overrides:
setRemoteIdent in interface TransportProtocolCommon
Parameters:
ident -

setRemoteKexInit

protected void setRemoteKexInit(SshMsgKexInit msg)
Overrides:
setRemoteKexInit in interface TransportProtocolCommon
Parameters:
msg -

setupNewKeys

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

verifyHostKey

protected boolean verifyHostKey(byte[] key,
                                byte[] sig,
                                byte[] sigdata)
            throws TransportProtocolException
Parameters:
key -
sig -
sigdata -
Returns:

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