|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.sshtools.j2ssh.transport.TransportProtocolCommon
|
+--com.sshtools.j2ssh.transport.TransportProtocolClient
Implements the client side of the SSH transport protocol. Specifically this class initiates client side key exchange operations and provides a mechanism to request SSH services from the remote server.
| Field Summary |
| Fields inherited from class com.sshtools.j2ssh.transport.TransportProtocolCommon |
clientIdent, clientKexInit, completeOnNewKeys, exchangeHash, hostKey, hosts, k, kex, log, messageStore, pk, properties, PROTOCOL_VERSION, serverIdent, serverKexInit, signature, SOFTWARE_VERSION_COMMENTS |
| Constructor Summary | |
TransportProtocolClient(java.net.Socket socket,
SshConnectionProperties properties,
HostKeyVerification hosts)
Constructor for the SshTransportProtocolClient object |
|
| Method Summary | |
protected java.lang.String |
getDecryptionAlgorithm()
Returns the decryption algorithm to be used after key exchange. |
protected java.lang.String |
getEncryptionAlgorithm()
Returns the encryption algorithm to be used after key exchange. |
protected java.lang.String |
getInputStreamCompAlgortihm()
Returns the input stream compression algorithm to be used after key exchange. |
protected java.lang.String |
getInputStreamMacAlgorithm()
Returns the input stream MAC algorithm to be used after key exchange. |
protected java.lang.String |
getLocalIdent()
Returns the local protocol identification string. |
protected com.sshtools.j2ssh.transport.SshMsgKexInit |
getLocalKexInit()
Gets the local sides kex init message. |
protected java.lang.String |
getOutputStreamCompAlgorithm()
Returns the output stream compression algorithm to be used after key exchange. |
protected java.lang.String |
getOutputStreamMacAlgorithm()
Returns the output stream MAC algorithm to be used after key exchange. |
protected java.lang.String |
getRemoteIdent()
Returns the remote computers protocol identification string. |
protected com.sshtools.j2ssh.transport.SshMsgKexInit |
getRemoteKexInit()
Gets the remote computers kex init message |
protected boolean |
onBeginKeyExchange(SshKeyExchange kex)
Called by the abstract super class when key exchange begins. |
void |
onMessageReceived(SshMessage msg)
Called by the framework when a registered message is received. |
protected void |
onMsgServiceAccept(com.sshtools.j2ssh.transport.SshMsgServiceAccept msg)
Handles the SSH_MSG_SERVICE_ACCEPT message |
Service |
requestService(java.lang.String serviceName)
Requests that the remote computer start the specified service. |
protected void |
setLocalIdent()
Sets the local sides identification string. |
protected void |
setLocalKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
Called by the abstract super class to set the relevant kex init member variable according to the subclasses operation (client or server) |
protected void |
setRemoteIdent(java.lang.String ident)
Sets the remote sides identification string. |
protected void |
setRemoteKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
Called by the abstract super class to set the remote sides kex init message. |
protected boolean |
verifyHostKey()
Verifies the server host key using the public key algorithm negotiated during key exchange. |
| Methods inherited from class com.sshtools.j2ssh.transport.TransportProtocolCommon |
beginKeyExchange, completeKeyExchange, determineAlgorithm, disconnect, getKexAlgorithm, getState, onChildThreadException, onCorruptMac, onMessageData, registerMessage, removeServiceThread, reportDisconnect, reportException, run, sendDisconnect, sendKeyExchangeInit, sendMessage, sendNewKeys, setServiceThread, stop, unregisterMessage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TransportProtocolClient(java.net.Socket socket,
SshConnectionProperties properties,
HostKeyVerification hosts)
throws TransportProtocolException
socket - The connected socket.properties - The SSH connection properties for
the current connectionhosts - Description of the Parameter
TransportProtocolException - Description of the Exception| Method Detail |
protected void setLocalIdent()
setLocalIdent in class TransportProtocolCommonprotected void setRemoteIdent(java.lang.String ident)
setRemoteIdent in class TransportProtocolCommonident - The protocol version string receivedprotected java.lang.String getLocalIdent()
getLocalIdent in class TransportProtocolCommonprotected java.lang.String getRemoteIdent()
getRemoteIdent in class TransportProtocolCommonprotected void setLocalKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
setLocalKexInit in class TransportProtocolCommonmsg - The kex init message sent by the local machineprotected void setRemoteKexInit(com.sshtools.j2ssh.transport.SshMsgKexInit msg)
setRemoteKexInit in class TransportProtocolCommonmsg - The kex init message received from the remote computer.protected com.sshtools.j2ssh.transport.SshMsgKexInit getLocalKexInit()
getLocalKexInit in class TransportProtocolCommonprotected com.sshtools.j2ssh.transport.SshMsgKexInit getRemoteKexInit()
getRemoteKexInit in class TransportProtocolCommon
protected java.lang.String getEncryptionAlgorithm()
throws AlgorithmNotAgreedException
getEncryptionAlgorithm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if an algorithm cannot be
agreed
protected java.lang.String getDecryptionAlgorithm()
throws AlgorithmNotAgreedException
getDecryptionAlgorithm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if the algorithm cannot be
agreed.
protected java.lang.String getOutputStreamMacAlgorithm()
throws AlgorithmNotAgreedException
getOutputStreamMacAlgorithm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if an algorithm cannot be
agreed.
protected java.lang.String getInputStreamMacAlgorithm()
throws AlgorithmNotAgreedException
getInputStreamMacAlgorithm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if an algorithm cannot be
agreed.
protected java.lang.String getOutputStreamCompAlgorithm()
throws AlgorithmNotAgreedException
getOutputStreamCompAlgorithm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if an algorithm cannot be
agreed.
protected java.lang.String getInputStreamCompAlgortihm()
throws AlgorithmNotAgreedException
getInputStreamCompAlgortihm in class TransportProtocolCommonAlgorithmNotAgreedException - Thrown if an algorithm cannot be
agreed.
public Service requestService(java.lang.String serviceName)
throws TransportProtocolException,
ServiceOperationException
serviceName - The service name to start
TransportProtocolException - Thrown if a transport protocol
exception occurs
ServiceOperationException - Thrown if the service does not
initialize properly.
protected boolean verifyHostKey()
throws InvalidHostKeyException,
InvalidHostKeySignatureException,
AlgorithmNotAgreedException,
AlgorithmNotSupportedException,
InvalidHostFileException
InvalidHostKeyException - Description of the Exception
InvalidHostKeySignatureException - Description of the Exception
AlgorithmNotAgreedException - Description of the Exception
AlgorithmNotSupportedException - Description of the Exception
InvalidHostFileException - Description of the Exception
protected boolean onBeginKeyExchange(SshKeyExchange kex)
throws TransportProtocolException
onBeginKeyExchange in class TransportProtocolCommonkex - Description of the Parameter
TransportProtocolException - Can be thrown to indicate a fatal
error (not key exchange failure)protected void onMsgServiceAccept(com.sshtools.j2ssh.transport.SshMsgServiceAccept msg)
msg - The message receivedpublic void onMessageReceived(SshMessage msg)
onMessageReceived in class TransportProtocolCommonmsg - The message received.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||