|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.io.BlockIO
ewe.io.BlockInputStream
A BlockInputStream is used to read in distinct blocks of data as sent by BlockOutputStream. The data sent by the BlockOutputStream may be Secure Documents as represented by ewe.security.SecureDocument and this BlockInputStream will then attempt to decode and validate them using the encryption parameters as provided by setPassword() and setKeys().
| Field Summary | |
protected InputStream |
in
|
| Fields inherited from class ewe.io.BlockIO |
intBuff, isOutput, secureDocument |
| Constructor Summary | |
BlockInputStream(InputStream in)
Create a BlockInputStream using the provided InputStream for reading in data. |
|
| Method Summary | |
void |
close()
close this BlockInputStream and the underlying input stream. |
ByteArray |
readBlock()
This is used to read the next block of incoming data. |
ByteArray |
readBlock(ByteArray dest)
This is used to read the next block of incoming data. |
void |
setDecryptor(DataProcessor decryptor)
Set the decryptor to be used explicitly. |
void |
setDecryptor(String password)
Set the decryptor by creating a new Decryptor which uses the provided password. |
void |
setKeys(EncryptionKey myPrivateKey,
EncryptionKey remotePublicKey)
Set the Public/Private keys. |
| Methods inherited from class ewe.io.BlockIO |
createSecureDocument, getSecureDocument |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
protected InputStream in
| Constructor Detail |
public BlockInputStream(InputStream in)
| Method Detail |
public void setDecryptor(DataProcessor decryptor)
throws IOException
IOException
public void setDecryptor(String password)
throws IOException
IOException
public ByteArray readBlock(ByteArray dest)
throws IOException
dest - an optional destination ByteArray. If this is null a new one is created.
The destination ByteArray is always cleared before the new data is added.
IOException - if an error occured reading or decoding or decrypting the data.
public ByteArray readBlock()
throws IOException
IOException - if an error occured reading or decoding or decrypting the data.
public void close()
throws IOException
IOException - if an error occured closing the underlying stream.
public void setKeys(EncryptionKey myPrivateKey,
EncryptionKey remotePublicKey)
myPrivateKey - This is used to decrypt the symmetric session key for each block of data.remotePublicKey - The remotePublicKey is used to verify the signature
of data signed by the sender. If it is null signatures will not be verified.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||