|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.store.FileStore
org.h2.security.SecureFileStore
public class SecureFileStore
A file store that encrypts all data before writing, and decrypts all data after reading. Areas that were never written to (for example after calling setLength to enlarge the file) are not encrypted (contains 0 bytes).
Field Summary |
---|
Fields inherited from class org.h2.store.FileStore |
---|
empty, handler, HEADER_LENGTH, name |
Constructor Summary | |
---|---|
SecureFileStore(DataHandler handler,
java.lang.String name,
java.lang.String mode,
java.lang.String cipher,
byte[] key,
int keyIterations)
|
Method Summary | |
---|---|
protected byte[] |
generateSalt()
Generate the random salt bytes if required. |
protected void |
initKey(byte[] salt)
Initialize the key using the given salt. |
void |
readFully(byte[] b,
int off,
int len)
Read a number of bytes. |
protected void |
readFullyDirect(byte[] b,
int off,
int len)
Read a number of bytes without decrypting. |
void |
seek(long x)
Go to the specified file location. |
void |
write(byte[] b,
int off,
int len)
Write a number of bytes. |
protected void |
writeDirect(byte[] b,
int off,
int len)
Write a number of bytes without encrypting. |
Methods inherited from class org.h2.store.FileStore |
---|
autoDelete, close, closeAndDeleteSilently, closeFile, closeSilently, getFilePointer, init, isTextMode, length, open, open, open, openFile, releaseLock, setCheckedWriting, setLength, stopAutoDelete, sync, tryLock |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SecureFileStore(DataHandler handler, java.lang.String name, java.lang.String mode, java.lang.String cipher, byte[] key, int keyIterations)
Method Detail |
---|
protected byte[] generateSalt()
FileStore
generateSalt
in class FileStore
protected void initKey(byte[] salt)
FileStore
initKey
in class FileStore
salt
- the saltprotected void writeDirect(byte[] b, int off, int len)
FileStore
writeDirect
in class FileStore
b
- the source bufferoff
- the offsetlen
- the number of bytes to writepublic void write(byte[] b, int off, int len)
FileStore
write
in class FileStore
b
- the source bufferoff
- the offsetlen
- the number of bytes to writeprotected void readFullyDirect(byte[] b, int off, int len)
FileStore
readFullyDirect
in class FileStore
b
- the target bufferoff
- the offsetlen
- the number of bytes to readpublic void readFully(byte[] b, int off, int len)
FileStore
readFully
in class FileStore
b
- the target bufferoff
- the offsetlen
- the number of bytes to readpublic void seek(long x)
FileStore
seek
in class FileStore
x
- the location
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |