|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.OutputStream | +--com.objectwave.crypto.CryptoOutputStream
Encrypt bytes written to this stream into 16-byte blocks using the Square cryptography algorithm. before writing them to the underlying OutputStream.
Constructor Summary | |
CryptoOutputStream(java.io.OutputStream underlying,
java.lang.String password)
Construct an instance of CryptoOutputStream for writing securely encrypted data to the unserlying output stream. |
Method Summary | |
void |
flush()
Flush the stream. |
static void |
main(java.lang.String[] args)
|
void |
setPassword(java.lang.String password)
Set the password. |
void |
write(int ch)
Securely write a byte to the underlying outptt stream. |
protected void |
write(int ch,
boolean flush)
The protected method where the data is actually written. |
Methods inherited from class java.io.OutputStream |
close, write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CryptoOutputStream(java.io.OutputStream underlying, java.lang.String password)
password
- the password to use for encrypting the data.Method Detail |
public void flush() throws java.io.IOException
flush
in class java.io.OutputStream
java.io.IOException
- thrown if there's an error flushing the
data to the underlying output stream.public static void main(java.lang.String[] args)
public void setPassword(java.lang.String password)
Square
crypto object.
This method would not normally be called: the user would typically set
the password via the constructor. Changing the password after having
written data means that the reader of this stream must be informed of
the change somehow.
password
- the password string to use to decrypt the encrypted data.public void write(int ch) throws java.io.IOException
flush()
, though up to CRYPTO_LEN
useless bytes may be written as a result of this call.
write
in class java.io.OutputStream
ch
- int the byte to write
java.io.IOException
- thrown is there's an error writing to the
underlying output stream.protected void write(int ch, boolean flush) throws java.io.IOException
ch
- int The byte the write (if flush==false)flush
- boolean If true and there's at least one byte in the
internal buffer, then a block is guaranteed to be written.
java.io.IOException
- thrown if there's an error writing
to the underlying output stream.flush()
,
write(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |