|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jscape.inet.ssh.transport.MessageStream
com.jscape.inet.ssh.transport.MessageReader
public final class MessageReader
The SSH message reader.
Constructor Summary | |
---|---|
MessageReader(java.io.InputStream in,
Compression decompressor,
javax.crypto.Cipher cipher,
javax.crypto.Mac mac)
Creates a new in instance. |
Method Summary | |
---|---|
void |
close()
Closes the reader. |
boolean |
isMacCheckAllowed()
Checks if the SSH messages MAC verification is turned on. |
boolean |
knowsMessage(int type)
|
java.lang.String |
readLine()
Reads a string line. |
Message |
readMessage()
Reads incoming message from the underlayed input stream. |
void |
registerMessage(int type,
java.lang.Class messageClass)
|
void |
setCipher(javax.crypto.Cipher cipher)
Setups the current stream cipher. |
void |
setMacCheckAllowed(boolean macCheckAllowed)
Setups the SSH messages MAC verification. |
void |
unregisterMessage(int type)
|
Methods inherited from class com.jscape.inet.ssh.transport.MessageStream |
---|
getBytesCount, setCompression, setMac |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageReader(java.io.InputStream in, Compression decompressor, javax.crypto.Cipher cipher, javax.crypto.Mac mac)
in
- the target input streamdecompressor
- the message compressioncipher
- the message ciphermac
- the message MACMethod Detail |
---|
public void setCipher(javax.crypto.Cipher cipher)
MessageStream
setCipher
in class MessageStream
cipher
- the current stream cipherMessageStream.setCipher(javax.crypto.Cipher)
public boolean isMacCheckAllowed()
true
if the MAC verification is turned on;
false
otherwisepublic void setMacCheckAllowed(boolean macCheckAllowed)
macCheckAllowed
- if true
the MAC verification will be
turned onpublic void registerMessage(int type, java.lang.Class messageClass)
type
- messageClass
- public void unregisterMessage(int type)
type
- public boolean knowsMessage(int type)
type
-
public void close()
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic Message readMessage() throws java.io.IOException
java.io.IOException
- if an I/O error occurs
TransportException
- if MAC verification error occurs
|
Secure iNet Factory | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |