|
|||||||||
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 String |
cipher
The cipher for encrypting the serialized object. |
static SecureRandom |
random
The random number generator for generating a new key. |
Constructor Summary | |
CriticalObject(Object o)
Creates a new CriticalObject with a new random key. |
|
CriticalObject(Object o,
boolean destroyCriticalData)
Creates a new CriticalObject with a new random key. |
|
CriticalObject(Object o,
byte[] key)
Creates a new CriticalObject from a given key. |
|
CriticalObject(Object o,
byte[] key,
boolean destroyCriticalData)
Creates a new CriticalObject from a given key. |
Method Summary | |
protected static 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(Enumeration a)
|
static void |
destroy(float[] a)
|
static void |
destroy(Hashtable a)
|
static void |
destroy(int[] a)
|
static void |
destroy(long[] a)
|
static void |
destroy(Object a)
|
static void |
destroy(Object[] a)
|
static void |
destroy(Vector a)
|
Object |
getObject()
Returns the proteced CriticalObject. |
Object |
getObject(byte[] key)
Returns the proteced CriticalObject encrypted with a given key. |
protected static byte[] |
serialize(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 String cipher
public static SecureRandom random
Constructor Detail |
public CriticalObject(Object o) throws 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 protectIOException
- if an error during the serializiation occurspublic CriticalObject(Object o, boolean destroyCriticalData) throws 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 invokedIOException
- if an error during the serializiation occurspublic CriticalObject(Object o, byte[] key) throws 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 keyIOException
- if an error during the serializiation occurspublic CriticalObject(Object o, byte[] key, boolean destroyCriticalData) throws 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 invokedIOException
- if an error during the serializiation occursMethod Detail |
public Object getObject(byte[] key) throws IOException
key
- the key used when generating the CriticalObjectpublic Object getObject() throws IOException
protected static Object deserialize(byte[] object) throws IOException
object
- the object as a byte arrayprotected static byte[] serialize(Object obj) throws 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(Object[] a)
public static void destroy(Object a)
public static void destroy(Vector a)
public static void destroy(Hashtable a)
public static void destroy(Enumeration a)
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |