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.
-
ident
-
-
PublicKeySecuredObject()
- general constructor used by externalisable.
-
PublicKeySecuredObject(Object, Cipher, SecureRandom)
- create a public key secured object using the standard algorithm
and the standard provider for the secret key.
-
PublicKeySecuredObject(Object, Cipher, SecureRandom, String, String)
- create a public key secured object.
-
getDecryptor()
- return a Cipher capable of decrypting another object encrypted
with the same secret key as this one.
-
getEncryptor()
- return a Cipher capable of encrypting another object with
the secret key used to encrypt this one.
-
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
PublicKeySecuredObject
public PublicKeySecuredObject()
- general constructor used by externalisable.
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.
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.
getIV
public byte[] getIV()
- returns a copy of the initialisation vector.
- Returns:
- the IV vector for the cipher that encrypted the secret key's
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.
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.
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.
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