public class DefaultCrypto extends Object
| Constructor and Description |
|---|
DefaultCrypto()
The default cryptographic interface only implements
the most simple way of garbling the byte data.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(Transaction trans)
Transport cryptographic data over a transaction.
|
static byte[] |
compress(byte[] data)
Tries to compress the input data to a smaller chunk.
|
static byte[] |
compress(byte[] data,
int offset,
int length)
Tries to compress the input data to a smaller chunk.
|
static byte[] |
decompress(byte[] data)
Decompress the data.
|
byte[] |
decrypt(byte[] data)
Decrypts the data (can also decompress it if required).
|
byte[] |
encrypt(byte[] data)
Encrypts the data (can also compress it if required).
|
byte[] |
encrypt(byte[] data,
int offset,
int endOffset)
Encrypts the data (can also compress it if required).
|
void |
read(Transaction trans)
Retrieve cryptographic information from a transaction.
|
public DefaultCrypto()
In this implementation, nothing needs to be done in the constructor.
public void append(Transaction trans)
public void read(Transaction trans)
public byte[] encrypt(byte[] data)
Note: if any changes to the buffer is required and the buffer is of the same length, use the original buffer in order to spare the virtual machine of any memory freeing. In this case, the same buffer is returned as only the content have changed, not the size.
public byte[] encrypt(byte[] data,
int offset,
int endOffset)
Note: if any changes to the buffer is required and the buffer is of the same length, use the original buffer in order to spare the virtual machine of any memory freeing. In this case, the same buffer is returned as only the content have changed, not the size.
public byte[] decrypt(byte[] data)
Note: if any changes to the buffer is required and the buffer is of the same length, use the original buffer in order to spare the virtual machine of any memory freeing. In this case, the same buffer is returned as only the content have changed, not the size.
public static byte[] compress(byte[] data)
data - the input data to compress.public static byte[] compress(byte[] data,
int offset,
int length)
data - the input data to compress.public static byte[] decompress(byte[] data)
throws IOException
IOException - for uncompress errors.Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.