public class SecureBlockInputStream extends BlockInputStream
| Modifier and Type | Field and Description |
|---|---|
protected SecureDocument |
secureDocument |
in, intBuff, maximumInputBlockSize| Constructor and Description |
|---|
SecureBlockInputStream(InputStream in)
Create a SecureBlockInputStream using the provided InputStream for reading
in data.
|
| Modifier and Type | Method and Description |
|---|---|
protected SecureDocument |
createSecureDocument() |
protected void |
decrypt(byte[] data,
int offset,
int length,
ByteArray dest)
This decrypts the incoming data.
|
protected SecureDocument |
getSecureDocument() |
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.
|
blockRead, close, readBlock, readBlockprotected SecureDocument secureDocument
public SecureBlockInputStream(InputStream in)
protected SecureDocument getSecureDocument()
protected SecureDocument createSecureDocument()
public void setDecryptor(DataProcessor decryptor) throws IOException
IOExceptionpublic void setDecryptor(String password) throws IOException
IOExceptionpublic 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.protected void decrypt(byte[] data,
int offset,
int length,
ByteArray dest)
throws UnknownEncodingException,
IOException
decrypt in class BlockInputStreamdata - the data bytes read in.offset - the offset of the data.length - the number of bytes of data.dest - a destination ByteArray that will not be null and would have been
cleared before being passed here.UnknownEncodingException - if the data could not be decoded/decrypted.IOException - if there was a problem decrypting the data.