Quadcap Embeddable Database

com.quadcap.sql.file.EncryptedBlockStore Class Reference

Inheritance diagram for com.quadcap.sql.file.EncryptedBlockStore:

com.quadcap.sql.file.BlockStore List of all members.

Detailed Description

Author:
Stan Bailes

Definition at line 22 of file EncryptedBlockStore.java.

Public Member Functions

 EncryptedBlockStore ()
 Create a new EncryptedBlockStore object using the specified file and blocksize.

void setKey (SymmetricKey key) throws IOException
void read (long blockNum, byte[] buf) throws IOException
 Read a block into a buffer.

void write (long blockNum, byte[] buf) throws IOException
 Write a block from a buffer into the file.


Package Functions

byte[] makeDigest (String s)

Package Attributes

SymmetricKey key
Key encrypt
Key decrypt
byte[] buf0
ByteBuffer b0

Static Package Attributes

final int oHASH_PASSWD_start = BlockFile.oHASH_PASSWD_start
final int oHASH_PASSWD_len = BlockFile.oHASH_PASSWD_len


Constructor & Destructor Documentation

com.quadcap.sql.file.EncryptedBlockStore.EncryptedBlockStore  ) 
 

Create a new EncryptedBlockStore object using the specified file and blocksize.

Parameters:
file the underlying file.
ra the randomly-accessible version of the file.
blocksize the block size to use for accessing the file.

Definition at line 37 of file EncryptedBlockStore.java.


Member Function Documentation

byte [] com.quadcap.sql.file.EncryptedBlockStore.makeDigest String  s  )  [package]
 

Definition at line 68 of file EncryptedBlockStore.java.

References com.quadcap.crypto.Digest.digest(), com.quadcap.sql.file.EncryptedBlockStore.makeDigest(), and com.quadcap.crypto.Digest.update().

Referenced by com.quadcap.sql.file.EncryptedBlockStore.makeDigest(), and com.quadcap.sql.file.EncryptedBlockStore.setKey().

void com.quadcap.sql.file.EncryptedBlockStore.read long  blockNum,
byte[]  buf
throws IOException
 

Read a block into a buffer.

If the specified block is beyond the current end of file, then grow the file

Parameters:
blockNum the number of the block to read.
buf the buffer into which the data is read.

Reimplemented from com.quadcap.sql.file.BlockStore.

Definition at line 85 of file EncryptedBlockStore.java.

References com.quadcap.sql.file.EncryptedBlockStore.b0, com.quadcap.sql.file.EncryptedBlockStore.buf0, com.quadcap.sql.file.EncryptedBlockStore.decrypt, and com.quadcap.sql.file.EncryptedBlockStore.read().

Referenced by com.quadcap.sql.file.EncryptedBlockStore.read().

void com.quadcap.sql.file.EncryptedBlockStore.setKey SymmetricKey  key  )  throws IOException
 

Definition at line 43 of file EncryptedBlockStore.java.

References com.quadcap.sql.file.EncryptedBlockStore.b0, com.quadcap.sql.file.EncryptedBlockStore.buf0, com.quadcap.sql.file.BlockStore.isEncrypted(), com.quadcap.sql.file.EncryptedBlockStore.key, com.quadcap.sql.file.EncryptedBlockStore.makeDigest(), com.quadcap.sql.file.EncryptedBlockStore.oHASH_PASSWD_len, com.quadcap.sql.file.EncryptedBlockStore.oHASH_PASSWD_start, com.quadcap.sql.file.FileRandomAccess.read(), com.quadcap.sql.file.EncryptedBlockStore.setKey(), and com.quadcap.sql.file.FileRandomAccess.write().

Referenced by com.quadcap.sql.file.EncryptedBlockStore.setKey().

void com.quadcap.sql.file.EncryptedBlockStore.write long  blockNum,
byte[]  buf
throws IOException
 

Write a block from a buffer into the file.

Parameters:
blockNum the number of the block to write.
buf the buffer from which the data is written.
Exceptions:
IOException if an I/O error occurs.

Reimplemented from com.quadcap.sql.file.BlockStore.

Definition at line 106 of file EncryptedBlockStore.java.

References com.quadcap.sql.file.EncryptedBlockStore.b0, com.quadcap.sql.file.EncryptedBlockStore.buf0, com.quadcap.sql.file.EncryptedBlockStore.encrypt, and com.quadcap.sql.file.EncryptedBlockStore.write().

Referenced by com.quadcap.sql.file.EncryptedBlockStore.write().


Member Data Documentation

ByteBuffer com.quadcap.sql.file.EncryptedBlockStore.b0 [package]
 

Definition at line 27 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.read(), com.quadcap.sql.file.EncryptedBlockStore.setKey(), and com.quadcap.sql.file.EncryptedBlockStore.write().

byte [] com.quadcap.sql.file.EncryptedBlockStore.buf0 [package]
 

Definition at line 26 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.read(), com.quadcap.sql.file.EncryptedBlockStore.setKey(), and com.quadcap.sql.file.EncryptedBlockStore.write().

Key com.quadcap.sql.file.EncryptedBlockStore.decrypt [package]
 

Definition at line 25 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.read().

Key com.quadcap.sql.file.EncryptedBlockStore.encrypt [package]
 

Definition at line 24 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.write().

SymmetricKey com.quadcap.sql.file.EncryptedBlockStore.key [package]
 

Definition at line 23 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.setKey().

final int com.quadcap.sql.file.EncryptedBlockStore.oHASH_PASSWD_len = BlockFile.oHASH_PASSWD_len [static, package]
 

Definition at line 41 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.setKey().

final int com.quadcap.sql.file.EncryptedBlockStore.oHASH_PASSWD_start = BlockFile.oHASH_PASSWD_start [static, package]
 

Definition at line 40 of file EncryptedBlockStore.java.

Referenced by com.quadcap.sql.file.EncryptedBlockStore.setKey().