|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.monica.javacom.ssh.MJCSSHTransportPackageTokenizer
Class for providing functionality to create and receive SSH2 packets. This class is able to create according to the specified MAC and Ciphering algorithms packets from the given payload, and is also able to read SSH2 packets from the given String stream, by using MAC and Ciphering.
Constructor Summary | |
MJCSSHTransportPackageTokenizer()
Default constructor. |
Method Summary | |
void |
arrived(java.lang.String s)
This method tells this object that at the to be processsed stream new data has arrived. |
java.lang.String |
createPackage(java.lang.String payload)
Creates an encrypted, MAC-ed, compressed SSH2 transport packet from the supplied payload and returns it as a String. |
java.lang.String |
getLastError()
Returns the description of the last occured error. |
MJCSSHTransportPackage |
getNextPackage()
Returns the next available packet from the processed packets. |
boolean |
isAvailable()
Returns true if there are processed packets that can be retrieved. |
void |
setCipherAlgorithm(MJCSSHCipherAlgorithm ca,
boolean dir)
Sets the Cipheralgorithm that has to be used. |
void |
setCompressionAlgorithm(MJCSSHCompressionAlgorithm ca,
boolean dir)
Sets the Compression algorithm that has to be used. |
void |
setKeys(java.lang.String iv,
java.lang.String ek,
java.lang.String ik,
boolean dir)
Sets the keys for encryption (iv, key) and integrity. |
void |
setMACAlgorithm(MJCSSHMACAlgorithm ma,
boolean dir)
Sets the MAC algorithm that has to be used. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MJCSSHTransportPackageTokenizer()
Method Detail |
public void setKeys(java.lang.String iv, java.lang.String ek, java.lang.String ik, boolean dir)
String
- iv: the initialization vector for cipheringString
- ek: the encryption keyString
- ik: the integrity key (for MAC)boolean
- dir: true for client to server, false for server to clientpublic void setMACAlgorithm(MJCSSHMACAlgorithm ma, boolean dir)
MJCSSHMACAlgorithm:
- the MAC algorithm to be usedboolean
- dir: true for client to server, false for server to clientpublic void setCipherAlgorithm(MJCSSHCipherAlgorithm ca, boolean dir)
MJCSSCipherAlgorithm:
- the Cipher algorithm to be usedboolean
- dir: true for client to server, false for server to clientpublic void setCompressionAlgorithm(MJCSSHCompressionAlgorithm ca, boolean dir)
MJCSSHCompressionAlgorithm:
- the MAC algorithm to be usedboolean
- dir: true for client to server, false for server to clientpublic void arrived(java.lang.String s) throws java.lang.Exception
String
- s: the arrived dataException:
- if there has been an Exception during the processing of
the arrived datapublic boolean isAvailable()
public MJCSSHTransportPackage getNextPackage()
public java.lang.String getLastError()
public java.lang.String createPackage(java.lang.String payload)
String
- payload: the packet payload
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |