Skip to Content
Java in a Nutshell, 5th Edition
book

Java in a Nutshell, 5th Edition

by David Flanagan
March 2005
Intermediate to advanced
1254 pages
104h 21m
English
O'Reilly Media, Inc.
Content preview from Java in a Nutshell, 5th Edition

Name

SealedObject

Synopsis

This class is a wrapper around a serializable object. It serializes the object and encrypts the resulting data stream, thereby protecting the confidentiality of the object. Create a SealedObject by specifying the object to be sealed and a Cipher object to perform the encryption. Retrieve the sealed object by calling getObject( ) and specifying the Cipher or java.security.Key to use for decryption. The SealedObject keeps track of the encryption algorithm and parameters so that a Key object alone can decrypt the object.

javax.crypto.SealedObject

Figure 17-9. javax.crypto.SealedObject

public class SealedObject implements Serializable {
// Public Constructors
     public SealedObject(Serializable object, Cipher c) 
        throws java.io.IOException, IllegalBlockSizeException;  
// Protected Constructors
     protected SealedObject(SealedObject so);  
// Public Instance Methods
     public final String getAlgorithm( );  
     public final Object getObject(java.security.Key key)
        throws java.io.IOException, ClassNotFoundException, 
        java.security.NoSuchAlgorithmException, java.security.InvalidKeyException;  
     public final Object getObject(Cipher c) 
        throws java.io.IOException, ClassNotFoundException, 
        IllegalBlockSizeException, BadPaddingException;  
     public final Object getObject(java.security.Key key, String provider) throws java.io.IOException, ClassNotFoundException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java in a Nutshell, 8th Edition

Java in a Nutshell, 8th Edition

Benjamin J. Evans, Jason Clark, David Flanagan
Java in a Nutshell, 7th Edition

Java in a Nutshell, 7th Edition

Benjamin J. Evans, David Flanagan
Learning Java, 5th Edition

Learning Java, 5th Edition

Marc Loy, Patrick Niemeyer, Daniel Leuck
Learning Java, 4th Edition

Learning Java, 4th Edition

Patrick Niemeyer, Daniel Leuck

Publisher Resources

ISBN: 0596007736Supplemental ContentErrata Page