|
||||||||
| 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.
| 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. |
boolean |
isEncrypted()
Check if the file is encrypted. |
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 |
setLength(long newLength)
Set the length of the file. |
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, setCheckedWriting, stopAutoDelete, sync |
| 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)
throws java.sql.SQLException
java.sql.SQLException| Method Detail |
|---|
protected byte[] generateSalt()
FileStore
generateSalt in class FileStoreprotected void initKey(byte[] salt)
FileStore
initKey in class FileStoresalt - the salt
protected void writeDirect(byte[] b,
int off,
int len)
throws java.sql.SQLException
FileStore
writeDirect in class FileStoreb - the source bufferoff - the offsetlen - the number of bytes to write
java.sql.SQLException
public void write(byte[] b,
int off,
int len)
throws java.sql.SQLException
FileStore
write in class FileStoreb - the source bufferoff - the offsetlen - the number of bytes to write
java.sql.SQLException
protected void readFullyDirect(byte[] b,
int off,
int len)
throws java.sql.SQLException
FileStore
readFullyDirect in class FileStoreb - the target bufferoff - the offsetlen - the number of bytes to read
java.sql.SQLException
public void readFully(byte[] b,
int off,
int len)
throws java.sql.SQLException
FileStore
readFully in class FileStoreb - the target bufferoff - the offsetlen - the number of bytes to read
java.sql.SQLException
public void seek(long x)
throws java.sql.SQLException
FileStore
seek in class FileStorex - the location
java.sql.SQLException
public void setLength(long newLength)
throws java.sql.SQLException
FileStore
setLength in class FileStorenewLength - the new file size
java.sql.SQLExceptionpublic boolean isEncrypted()
FileStore
isEncrypted in class FileStore
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||