public abstract class Crypt
extends java.lang.Object
Constructor and Description |
---|
Crypt() |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] p_buffer,
int p_offset,
int p_length)
Decrypt an arbitrary buffer.
|
abstract void |
decryptBlocks(byte[] p_buffer,
int p_offset,
int p_length)
Decrypt a buffer in place that is a multiple of the block size for this
Crypt object is applicable.
|
byte[] |
encrypt(byte[] p_buffer,
int p_offset,
int p_length)
Encrypt an arbitrary buffer.
|
abstract void |
encryptBlocks(byte[] p_buffer,
int p_offset,
int p_length)
Encrypt a buffer in place that is a multiple of the block size for this
Crypt object is applicable.
|
abstract int |
getBlockSize()
Get the preferred block size for this encryption method.
|
static Crypt |
getCrypt(byte[] p_init,
java.lang.String p_password)
Get the appropriate Crypt object given an initialization buffer.
|
static Crypt |
getDefaultCrypt(boolean p_constant,
java.lang.String p_password,
java.util.Map p_modes)
Get the default Crypt object with either constant or randomized
initialization.
|
abstract byte[] |
getInitialization()
Get the initialization buffer suitable for reconstructing the Crypt
object.
|
public static Crypt getCrypt(byte[] p_init, java.lang.String p_password) throws FilesystemException
p_init
- Intialization buffer.p_password
- Crypt password.FilesystemException
- if unable to instantiate appropriate Crypt object.public static Crypt getDefaultCrypt(boolean p_constant, java.lang.String p_password, java.util.Map p_modes) throws FilesystemException
p_modes
- Modes for the initialization.FilesystemException
public byte[] encrypt(byte[] p_buffer, int p_offset, int p_length) throws FilesystemException
p_buffer
- Buffer to encrypt.p_offset
- Offset into buffer.p_length
- Length of buffer.FilesystemException
- on error.public byte[] decrypt(byte[] p_buffer, int p_offset, int p_length) throws FilesystemException
p_buffer
- Buffer to decrypt.p_offset
- Offset into buffer.p_length
- Length of buffer.FilesystemException
- on error.public abstract byte[] getInitialization()
public abstract int getBlockSize()
public abstract void encryptBlocks(byte[] p_buffer, int p_offset, int p_length) throws FilesystemException
p_buffer
- Buffer to encrypt in place.p_offset
- Offset into buffer.p_length
- Length of buffer.FilesystemException
- on error.public abstract void decryptBlocks(byte[] p_buffer, int p_offset, int p_length) throws FilesystemException
p_buffer
- Buffer to decrypt in place.p_offset
- Offset into buffer.p_length
- Length of buffer.FilesystemException
- on error.