Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


oracle.security.crypto.core
Class PasswordProtectedObject

java.lang.Object
  extended byoracle.security.crypto.core.PasswordProtectedObject

All Implemented Interfaces:
java.io.Serializable

public class PasswordProtectedObject
extends java.lang.Object
implements java.io.Serializable

This class implements PKCS5 password-based encryption of objects. It can be used with any Serializable object.

See Also:
Serialized Form

Field Summary
protected  byte[] encryptedData
           
protected  java.io.Serializable obj
           
protected  PKCS5 pkcs5
           

 

Constructor Summary
PasswordProtectedObject()
           
PasswordProtectedObject(int mode)
          Same using the default RandomBitsSource.
PasswordProtectedObject(int mode, RandomBitsSource rbs)
          Create a new PasswordProtectedObject with the given mode (from PKCS5) using a RandomBitsSource.
PasswordProtectedObject(PKCS5 p)
          Create a new PasswordProtectedObject with the given PKCS5 cipher.
PasswordProtectedObject(java.io.Serializable o)
           
PasswordProtectedObject(java.io.Serializable o, int mode)
           
PasswordProtectedObject(java.io.Serializable o, int mode, RandomBitsSource rbs)
           
PasswordProtectedObject(java.io.Serializable o, PKCS5 p)
          Create a new PasswordProtectedObject with the given cipher and encrypt the given object.
PasswordProtectedObject(java.io.Serializable o, RandomBitsSource rbs)
           

 

Method Summary
 java.lang.Object decrypt()
           
 void encrypt()
           
 PKCS5 getPKCS5()
           
 void setObject(java.io.Serializable o)
           
 void setPassword(java.lang.String pass)
          Set the password on the cipher (this needs to be done before encryption or decryption).
 void setPKCS5(PKCS5 p)
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

pkcs5

protected PKCS5 pkcs5

encryptedData

protected byte[] encryptedData

obj

protected transient java.io.Serializable obj

Constructor Detail

PasswordProtectedObject

public PasswordProtectedObject()

PasswordProtectedObject

public PasswordProtectedObject(PKCS5 p)
Create a new PasswordProtectedObject with the given PKCS5 cipher.

PasswordProtectedObject

public PasswordProtectedObject(int mode,
                               RandomBitsSource rbs)
Create a new PasswordProtectedObject with the given mode (from PKCS5) using a RandomBitsSource.

PasswordProtectedObject

public PasswordProtectedObject(int mode)
Same using the default RandomBitsSource.

PasswordProtectedObject

public PasswordProtectedObject(java.io.Serializable o,
                               PKCS5 p)
Create a new PasswordProtectedObject with the given cipher and encrypt the given object.

PasswordProtectedObject

public PasswordProtectedObject(java.io.Serializable o,
                               int mode,
                               RandomBitsSource rbs)

PasswordProtectedObject

public PasswordProtectedObject(java.io.Serializable o,
                               int mode)

PasswordProtectedObject

public PasswordProtectedObject(java.io.Serializable o,
                               RandomBitsSource rbs)

PasswordProtectedObject

public PasswordProtectedObject(java.io.Serializable o)

Method Detail

setPKCS5

public void setPKCS5(PKCS5 p)

getPKCS5

public PKCS5 getPKCS5()

setPassword

public void setPassword(java.lang.String pass)
Set the password on the cipher (this needs to be done before encryption or decryption).

setObject

public void setObject(java.io.Serializable o)

encrypt

public void encrypt()
             throws java.io.IOException
Throws:
java.io.IOException

decrypt

public java.lang.Object decrypt()
                         throws CipherException,
                                java.io.IOException,
                                java.lang.ClassNotFoundException
Throws:
CipherException
java.io.IOException
java.lang.ClassNotFoundException

Oracle Security Developer Tools Crypto Java API Reference
10g (10.1.4.0.1)

B28171-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.