org.logi.crypto.io
Class CipherStream
java.lang.Object
|
+--org.logi.crypto.Crypto
|
+--org.logi.crypto.io.CipherStream
- All Implemented Interfaces:
- PrettyPrintable
- Direct Known Subclasses:
- CipherStreamClient, CipherStreamServer
- public class CipherStream
- extends Crypto
Parent of CipherStreamClient and CipherStreamServer.
- Author:
- Logi Ragnarsson
(logir@logi.org)
- See Also:
CipherStreamServer
,
CipherStreamClient
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Methods inherited from class org.logi.crypto.Crypto |
binString, binString, ensureArrayLength, ensureArrayLength, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, prettyPrint, prettyPrint, readBlock, readInt, trimArrayLength, trimArrayLength, trimLeadingZeroes, writeBytes, writeBytes, writeInt |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CipherStream
public CipherStream()
getInputStream
public DecryptStream getInputStream()
- Get the encrypted input-stream.
getEncryptKey
public CipherKey getEncryptKey()
- Get the key used for encryption.
setEncryptKey
public void setEncryptKey(CipherKey key)
throws java.io.IOException,
CryptoException
- Re-key the EncryptSession used by this CipherStream. This induces a
flush of the outgoing stream.
- Throws:
java.io.IOException
- if there is a low-level problem.CryptoException
- if the internal buffer in the EncryptSession
is not empty.
getOutputStream
public EncryptStream getOutputStream()
- Get the encrypted output-stream.
getDecryptKey
public CipherKey getDecryptKey()
- Get the key used for decryption.
setDecryptKey
public void setDecryptKey(CipherKey key)
throws CryptoException
- Re-key the DecryptSession used by this DecryptStream. This causes the
incoming stream to be drained.
- Throws:
CryptoException
- if the internal buffer in the DecryptSession
is not empty.
close
public void close()
throws java.io.IOException
- Closes all streams and releases their resources.
- Throws:
java.io.IOException
- if one of the underlying objects refuse to be closed.
Copyright 1997-2000 Logi Ragnarsson