Contents | Package | Class | Tree | Deprecated | Index | Help | |||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----javax.crypto.SealedObject
Given any Serializable object, one can create a SealedObject that encapsulates the original object, in serialized format (i.e., a "deep copy"), and seals (encrypts) its serialized contents, using a cryptographic algorithm such as DES, to protect its confidentiality. The encrypted content can later be decrypted (with the corresponding algorithm using the correct decryption key) and de-serialized, yielding the original object.
Note that the Cipher object must be fully initialized with the correct algorithm, key, padding scheme, etc., before being applied to a SealedObject.
Constructor Summary | |
SealedObject(java.io.Serializable object,
Cipher c)
|
Method Summary | |
java.lang.Object | getObject(Cipher c)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SealedObject(java.io.Serializable object, Cipher c) throws java.io.IOException, IllegalBlockSizeException
The given object is sealed using the given Cipher, assuming that the Cipher is already properly initialized.
object
- the object to be sealed.
c
- the cipher used to seal the object.
Method Detail |
public final java.lang.Object getObject(Cipher c) throws java.io.IOException, java.lang.ClassNotFoundException, IllegalBlockSizeException, BadPaddingException
The encapsulated object is unsealed (using the given Cipher, assuming that the Cipher is already properly initialized) and de-serialized, before it is returned.
c
- the cipher used to unseal the object
Contents | Package | Class | Tree | Deprecated | Index | Help | |||
PREV | NEXT | SHOW LISTS | HIDE LISTS |