|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.crypto.SealedObject
Class for cryptographic "sealing" a serialized object.
Attention: This is not a SUN implementation!
This class has been developed by IAIK according to the documentation publically available.
For SUNīs documentation of this class see
http://java.sun.com/security/JCE1.2/spec/apidoc/index.html
This class can be used for protecting the confidentiality of a Serializable object.
For protecting the Serializable object, create a SealedObject by calling the constructor
with the given Serializable object and the Cipher to be used for encrypting.
For decrypting - and deserializing - the encrypted object again, use the
getobject(Cipher cipher)
method, where now the Cipher is initialized for
decryptiion.
getObject(javax.crypto.Cipher)
, Serialized FormField Summary | |
protected byte[] |
encodedParams
|
Constructor Summary | |
protected |
SealedObject(SealedObject so)
Create a new SealedObject cloning another. |
|
SealedObject(Serializable object,
Cipher c)
Creates a SealedObject from the given Serializable object using the given Cipher for encryption. |
Method Summary | |
String |
getAlgorithm()
Returns the algorithm that was used to seal this object. |
Object |
getObject(Cipher c)
Returns he original Serializable object from which this SealedObject has been created. |
Object |
getObject(Key key)
Retrieves the original (encapsulated) object. |
Object |
getObject(Key key,
String provider)
Retrieves the original (encapsulated) object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected byte[] encodedParams
Constructor Detail |
public SealedObject(Serializable object, Cipher c) throws IOException, IllegalBlockSizeException
object
- the Serializeable object to be sealedc
- the cipher used for sealing, initialized for encryptionIOException
- if an error occurs during serializationIllegalBlockSizeException
- if the total length of the processed data is not a multiple
of the block size for a (no padding performing) block cipherprotected SealedObject(SealedObject so)
Method Detail |
public final String getAlgorithm()
public final Object getObject(Cipher c) throws IOException, ClassNotFoundException, IllegalBlockSizeException, BadPaddingException
c
- the cipher used for unsealing, initialized for decryptionIOException
- if an error occurs during de-serialiazationClassNotFoundException
- if an error occurs during de-serialiazationIllegalBlockSizeException
- if the total length of the processed data is not a multiple
of the block size for a (no padding performing) block cipherBadPaddingException
- if the input data does not have proper padding bytes for data
decryption including (un)paddingpublic final Object getObject(Key key) throws IOException, ClassNotFoundException, NoSuchAlgorithmException, InvalidKeyException
key
- the key used to unseal the objectIOException
- if an error occurs during de-serialiazationClassNotFoundException
- if an error occurs during de-serialiazationNoSuchAlgorithmException
- if the algorithm to unseal the object is not availableInvalidKeyException
- if the given key cannot be used to unseal the object
(e.g., it has the wrong algorithm)public final Object getObject(Key key, String provider) throws IOException, ClassNotFoundException, NoSuchAlgorithmException, NoSuchProviderException, InvalidKeyException
key
- the key used to unseal the objectprovider
- the name of the provider of the algorithm to unseal the objectIOException
- if an error occurs during de-serialiazationClassNotFoundException
- if an error occurs during de-serialiazationNoSuchAlgorithmException
- if the algorithm to unseal the object is not availableNoSuchProviderException
- if the given provider is not configuredInvalidKeyException
- if the given key cannot be used to unseal the object
(e.g., it has the wrong algorithm)
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |