|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--iaik.utils.CriticalObject
This class can be used to secure critical objects in memory. The object to be secured must implement the Serializable interface.
| Field Summary | |
static java.lang.String |
cipher
The cipher for encrypting the serialized object. |
static SecureRandom |
random
The random number generator for generating a new key. |
| Constructor Summary | |
CriticalObject(java.lang.Object o)
Creates a new CriticalObject with a new random key. |
|
CriticalObject(java.lang.Object o,
boolean destroyCriticalData)
Creates a new CriticalObject with a new random key. |
|
CriticalObject(java.lang.Object o,
byte[] key)
Creates a new CriticalObject from a given key. |
|
CriticalObject(java.lang.Object o,
byte[] key,
boolean destroyCriticalData)
Creates a new CriticalObject from a given key. |
|
| Method Summary | |
protected static java.lang.Object |
deserialize(byte[] object)
Deserializes a given object from a byte array. |
static void |
destroy(boolean[] a)
|
static void |
destroy(byte[] a)
|
static void |
destroy(double[] a)
|
static void |
destroy(java.util.Enumeration a)
|
static void |
destroy(float[] a)
|
static void |
destroy(java.util.Hashtable a)
|
static void |
destroy(int[] a)
|
static void |
destroy(long[] a)
|
static void |
destroy(java.lang.Object a)
|
static void |
destroy(java.lang.Object[] a)
|
static void |
destroy(java.util.Vector a)
|
java.lang.Object |
getObject()
Returns the proteced CriticalObject. |
java.lang.Object |
getObject(byte[] key)
Returns the proteced CriticalObject encrypted with a given key. |
protected static byte[] |
serialize(java.lang.Object obj)
Serializes a given object to a byte array. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static java.lang.String cipher
public static SecureRandom random
| Constructor Detail |
public CriticalObject(java.lang.Object o)
throws java.io.IOException
This method first serializes the object and then encrypts it. If the object has an accessable method "destroyCriticalData" this method is invoked after the encryption.
o - the critical object to protect
public CriticalObject(java.lang.Object o,
boolean destroyCriticalData)
throws java.io.IOException
This method first serializes the object and then encrypts it. If the object has an accessable method "destroyCriticalData" this method is invoked after the encryption.
o - the critical object to protectdestroyCriticalData - true if the method destroyCriticalData shall be invoked
public CriticalObject(java.lang.Object o,
byte[] key)
throws java.io.IOException
This method first serializes the object and then encrypts it. If the object has an accessable method "destroyCriticalData" this method is invoked after the encryption.
o - the critical object to protectkey - the key for generating an iv and a secret key
public CriticalObject(java.lang.Object o,
byte[] key,
boolean destroyCriticalData)
throws java.io.IOException
This method first serializes the object and then encrypts it. If the object has an accessable method "destroyCriticalData" this method is invoked after the encryption.
o - the critical object to protectkey - the key for generating an iv and a secret keydestroyCriticalData - true if the method destroyCriticalData shall be invoked| Method Detail |
public java.lang.Object getObject(byte[] key)
throws java.io.IOException
key - the key used when generating the CriticalObject
public java.lang.Object getObject()
throws java.io.IOException
protected static java.lang.Object deserialize(byte[] object)
throws java.io.IOException
object - the object as a byte array
protected static byte[] serialize(java.lang.Object obj)
throws java.io.IOException
obj - the object to serializepublic static void destroy(byte[] a)
public static void destroy(int[] a)
public static void destroy(long[] a)
public static void destroy(float[] a)
public static void destroy(double[] a)
public static void destroy(boolean[] a)
public static void destroy(java.lang.Object[] a)
public static void destroy(java.lang.Object a)
public static void destroy(java.util.Vector a)
public static void destroy(java.util.Hashtable a)
public static void destroy(java.util.Enumeration a)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||