May 2001
Intermediate to advanced
1088 pages
30h 13m
English
Sometimes, you might want to encrypt a Java object and write it to a file or send it over a network. Although you could combine the ObjectOutputStream class with CipherOutputStream to write the object and use CipherInputStream and ObjectInputStream to read it, there is a better way.
The SealedObject class is a special container that encrypts serialized objects and lets you retrieve them again.
To store an object in a SealedObject container, you must first create a Cipher, just as you do for other encryption/decryption processes. Then, just pass the object you want to encrypt and the Cipher to the SealedObject constructor:
SealedObject sealed = new SealedObject(myObject, myCipher);
Because the SealedObject class is serializable, ...
Read now
Unlock full access