|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--DataLoader
DataLoader is an IO interface used by RSA to read and write clear and encrypted data. Its default is that it is not bufferised, thus each call to a read method results in a disk access. As well for writes.
It was necessary to define a format for blocks of data. In this implementation, clear data is read by blocks of at most 126 bytes, and inserted in a 128 bytes large integer whose first byte is the length of the block of clear data read. This integer is then encrypted using rsa, and can be written to and read from a file. When decrypted and written as clear data to a file, only the number of bytes specified in the first bytes is indeed written to the file.
Constructor Summary | |
DataLoader(java.lang.String filein,
java.lang.String fileout)
Create a DataLoader defined by an file from which to read and a file in which to write. |
Method Summary | |
void |
close()
Close the streams manipulated by a DataLoader. |
java.math.BigInteger |
readClearBlock()
Read a block of data from a clear file. |
java.math.BigInteger |
readEncryptedBlock()
Read a block of encrypted data from an encrypted file. |
void |
writeClearBlock(java.math.BigInteger b)
Write a block of clear data to a file. |
void |
writeEncryptedBlock(java.math.BigInteger b)
Write a block of encrypted data to a file. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DataLoader(java.lang.String filein, java.lang.String fileout) throws java.lang.Exception
filein
- a file from which to read.fileout
- a file in which to write.Method Detail |
public void close()
public java.math.BigInteger readClearBlock() throws java.io.IOException
public java.math.BigInteger readEncryptedBlock() throws java.io.IOException
public void writeClearBlock(java.math.BigInteger b) throws java.io.IOException
b
- clear data encapsulated in a 128 bytes integer.public void writeEncryptedBlock(java.math.BigInteger b) throws java.io.IOException
a
- 1024 bits integer representing encrypted data.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |