All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.PublicKeySecuredObject

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

public class PublicKeySecuredObject
extends Object
implements Externalizable
a holding class for secret key encrypted objects which have their secret keys attached. The secret key is encrypted using some other algorithm.


Variable Index

 o ident

Constructor Index

 o PublicKeySecuredObject()
general constructor used by externalisable.
 o PublicKeySecuredObject(Object, Cipher, SecureRandom)
create a public key secured object using the standard algorithm and the standard provider for the secret key.
 o PublicKeySecuredObject(Object, Cipher, SecureRandom, String, String)
create a public key secured object.

Method Index

 o getDecryptor()
return a Cipher capable of decrypting another object encrypted with the same secret key as this one.
 o getEncryptor()
return a Cipher capable of encrypting another object with the secret key used to encrypt this one.
 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 PublicKeySecuredObject
 public PublicKeySecuredObject()
general constructor used by externalisable.

 o PublicKeySecuredObject
 public PublicKeySecuredObject(Object obj,
                               Cipher cipher,
                               SecureRandom random,
                               String algorithm,
                               String provider) throws IOException
create a public key secured object. The object is encrypted with a secret key and the secret key is encrypted with the cipher passed in.

Parameters:
obj - a serialisable object to be encrypted.
cipher - the cipher to be used for encrypting the secret key.
random - a random source for generating the secret key.
algorithm - the name of the algorithm that the object will be encrypted with.
provider - the provider name for the object encryption algorithm.
Throws: IOException
if object not serialisable or some other exception occurs.
 o PublicKeySecuredObject
 public PublicKeySecuredObject(Object obj,
                               Cipher cipher,
                               SecureRandom random) throws IOException
create a public key secured object using the standard algorithm and the standard provider for the secret key. The object is encrypted with the secret key and the secret key is encrypted with the cipher passed in.

Parameters:
obj - a serialisable object to be encrypted.
cipher - the cipher to be used for encrypting the secret key.
random - a random source for generating the secret key.
Throws: IOException
if object not serialisable or some other exception occurs.

Methods

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

Returns:
the IV vector for the cipher that encrypted the secret key's
 o getObject
 public Object getObject(Cipher cipher) throws IOException, ClassNotFoundException
Return the plain text object.

Parameters:
cipher - The cipher used to decrypt the secret key and allow the decryption of the object.
Returns:
The plain text object.
Throws: ClassNotFoundException
The object class could not be loaded.
 o getEncryptor
 public Cipher getEncryptor()
return a Cipher capable of encrypting another object with the secret key used to encrypt this one. Note: in the event you are dealing with an object constructed by someone else, this call is only meaningful if you have decrypted the object.

Returns:
the secret key cipher that was originally used, set up for encryption.
 o getDecryptor
 public Cipher getDecryptor()
return a Cipher capable of decrypting another object encrypted with the same secret key as this one.

Returns:
the secret key cipher that was originally used, set up for decryption.
 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