public class ClientSecurity extends Object
| Constructor and Description |
|---|
ClientSecurity() |
| Modifier and Type | Method and Description |
|---|---|
static ByteBuffer |
decrypt(ByteBuffer data)
Decrpyt the specified
data buffer. |
static ByteBuffer |
decrypt(ByteBuffer data,
byte[] key)
Decrpyt the specified
data buffer. |
static ByteBuffer |
encrypt(byte[] data,
byte[] key)
Encrypt the
data using the key |
static ByteBuffer |
encrypt(ByteBuffer data,
byte[] key)
Encrypt the
data using the key |
static ByteBuffer |
encrypt(String data)
Encrypt the specified
data string. |
static ByteBuffer |
encrypt(String data,
byte[] key)
Encrypt the
data string using the key |
static byte[] |
generateSecretKey()
Generate a random secret key that can be used for encryption and
decryption.
|
public static ByteBuffer decrypt(ByteBuffer data)
data buffer. This method returns a byte
buffer instead of a string so that the caller can set the buffer to
null once it is not longer in useful scope. Doing so will help to
narrow the window in which vulnerable information resides in memory.data - public static ByteBuffer decrypt(ByteBuffer data, byte[] key)
data buffer. This method returns a byte
buffer instead of a string so that the caller can set the buffer to
null once it is not longer in useful scope. Doing so will help to
narrow the window in which vulnerable information resides in memory.data - public static ByteBuffer encrypt(byte[] data, byte[] key)
data using the keydata - key - public static ByteBuffer encrypt(ByteBuffer data, byte[] key)
data using the keydata - key - public static ByteBuffer encrypt(String data)
data string.data - public static ByteBuffer encrypt(String data, byte[] key)
data string using the keydata - key - public static byte[] generateSecretKey()