All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.SecuredObject

java.lang.Object
   |
   +----au.net.aba.crypto.SecuredObject

public class SecuredObject
extends Object
implements Externalizable
a holding class for encrypted objects which have a verification hash attached.


Variable Index

 o ident

Constructor Index

 o SecuredObject()
base constructor needed for serialisation to work.
 o SecuredObject(Object, Cipher)
create a secret key secured object.

Method Index

 o getIV()
returns a copy of the initialisation vector.
 o getObject(Cipher)
Return the plain text object.
 o readExternal(ObjectInput)
serialisation support using Externalizable.
 o writeExternal(ObjectOutput)
serialisation support using Externalizable.

Variables

 o ident
 public static final String ident

Constructors

 o SecuredObject
 public SecuredObject()
base constructor needed for serialisation to work.

 o SecuredObject
 public SecuredObject(Object obj,
                      Cipher cipher) throws IOException
create a secret key secured object. The object is appended with a SHA-1 digest, and the system time is written at the front of the stream to remove the likelihood of two objects encrypting to the same or similar streams.

Parameters:
obj - the object to be encrypted.
cipher - the cipher to be used to encrypt the object.
Throws: IOException
if the object is not serialisable or some other error occurs.

Methods

 o getIV
 public byte[] getIV()
returns a copy of the initialisation vector.

Returns:
the IV vector for the cipher used to encrypt the object.
 o getObject
 public Object getObject(Cipher cipher) throws IOException, ClassNotFoundException
Return the plain text object.

Parameters:
cipher - The cipher to be used to decrypt the object.
Returns:
The object that was encrypted.
Throws: ClassNotFoundException
The object class could not be loaded.
 o writeExternal
 public void writeExternal(ObjectOutput out) throws IOException
serialisation support using Externalizable.

Parameters:
out - the object output stream.
 o readExternal
 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
serialisation support using Externalizable.

Parameters:
in - the object input stream.
Throws: ClassNotFoundException
- the class definition of the serialised object could not be loaded.

All Packages  Class Hierarchy  This Package  Previous  Next  Index