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.
-
ident
-
-
SecuredObject()
- base constructor needed for serialisation to work.
-
SecuredObject(Object, Cipher)
- create a secret key secured object.
-
getIV()
- returns a copy of the initialisation vector.
-
getObject(Cipher)
- Return the plain text object.
-
readExternal(ObjectInput)
- serialisation support using Externalizable.
-
writeExternal(ObjectOutput)
- serialisation support using Externalizable.
ident
public static final String ident
SecuredObject
public SecuredObject()
- base constructor needed for serialisation to work.
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.
getIV
public byte[] getIV()
- returns a copy of the initialisation vector.
- Returns:
- the IV vector for the cipher used to encrypt the object.
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.
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- serialisation support using Externalizable.
- Parameters:
- out - the object output stream.
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