Skip navigation links

Oracle Fusion Middleware Security Engine Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10674-03


oracle.security.crypto.cert
Class PKCS12Safe

java.lang.Object
  extended by oracle.security.crypto.cert.PKCS12Safe

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class PKCS12Safe
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object, java.io.Externalizable

An instance of the PKCS #12 SafeContents type, encrypted. It can contain multiple safe bags, represented as instances of PKCS12Bag.

Each PKCS12Safe object contains a reference to its parent, which is the PKCS12 object to which the safe belongs. The chief purpose of the reference is to obtain the encryption password.

See Also:
KeyPairPKCS12, PKCS12, PKCS12Bag, PKCS12CertBag, PKCS12ShroudedKeyBag, PKCS5, Serialized Form

Constructor Summary
PKCS12Safe()
          Creates a new empty instance.
PKCS12Safe(PKCS12 parent)
           
PKCS12Safe(PKCS12 parent, oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
           
PKCS12Safe(PKCS12 parent, oracle.security.crypto.asn1.ASN1Sequence s)
           
PKCS12Safe(PKCS12 parent, java.io.InputStream is)
           
PKCS12Safe(PKCS12 parent, int mode)
          Deprecated. Use PKCS12Safe(PKCS12, ASN1ObjectID) instead

 

Method Summary
 void addBag(PKCS12Bag b)
           
 java.util.Vector<PKCS12Bag> getBags()
          Deprecated. Use getBagsAsList()
 java.util.ArrayList<PKCS12Bag> getBagsAsList()
          Returns the ArrayList of PKCS12Bags contained in this safe.
 int getMode()
          Get the encryption mode used for this safe.
 char[] getPasswd()
          Returns the data encryption password for this PKCS12Safe.
 java.lang.String getPassword()
          Deprecated. Use getPasswd()
 oracle.security.crypto.asn1.ASN1ObjectID getPBEOID()
           
 void input(oracle.security.crypto.asn1.ASN1Sequence s)
          Reconstructs this object from its representation as an ASN.1 sequence.
 void input(java.io.InputStream is)
          Reconstructs this object by reading its DER encoding from the specified input stream.
 int length()
          Returns the length of this object's DER encoding.
 void output(java.io.OutputStream os)
          Outputs the DER encoding of this object to the specified output stream.
 void readExternal(java.io.ObjectInput is)
           
 void setBags(java.util.List<PKCS12Bag> bags)
           
 void setBags(java.util.Vector<PKCS12Bag> bags)
          Deprecated. Use setBags(List)
 void setMode(int mode)
           
 void setPasswd(char[] passwd)
          Sets the data encryption password for this PKCS12Safe.
 void setPassword(java.lang.String passwd)
          Deprecated. Use setPasswd(char[])
 void setPBEOID(oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
           
 java.lang.String toString()
          Returns a string representation of this object.
 void writeExternal(java.io.ObjectOutput os)
           

 

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

 

Constructor Detail

PKCS12Safe

public PKCS12Safe()
Creates a new empty instance. This constructor is to be used with serialization or with the input method.

PKCS12Safe

public PKCS12Safe(PKCS12 parent)

PKCS12Safe

public PKCS12Safe(PKCS12 parent,
                  int mode)
Deprecated. Use PKCS12Safe(PKCS12, ASN1ObjectID) instead

PKCS12Safe

public PKCS12Safe(PKCS12 parent,
                  oracle.security.crypto.asn1.ASN1ObjectID pbeOID)

PKCS12Safe

public PKCS12Safe(PKCS12 parent,
                  java.io.InputStream is)
           throws java.io.IOException
Throws:
java.io.IOException

PKCS12Safe

public PKCS12Safe(PKCS12 parent,
                  oracle.security.crypto.asn1.ASN1Sequence s)
           throws java.io.IOException
Throws:
java.io.IOException

Method Detail

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Reconstructs this object by reading its DER encoding from the specified input stream.
Specified by:
input in interface oracle.security.crypto.util.Streamable
Parameters:
is - the input stream from which this object will be read
Throws:
java.io.IOException

input

public void input(oracle.security.crypto.asn1.ASN1Sequence s)
           throws java.io.IOException
Reconstructs this object from its representation as an ASN.1 sequence.
Parameters:
s - the ASN.1 sequence representation of this object
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Outputs the DER encoding of this object to the specified output stream.
Specified by:
output in interface oracle.security.crypto.util.Streamable
Parameters:
os - the output stream to which the object will be written
Throws:
java.io.IOException

length

public int length()
Returns the length of this object's DER encoding.
Specified by:
length in interface oracle.security.crypto.util.Streamable
Returns:
the length of this object's DER encoding

setPassword

public void setPassword(java.lang.String passwd)
Deprecated. Use setPasswd(char[])
Sets the data encryption password for this PKCS12Safe. By default, the parent PKCS12's password is used.

setPasswd

public void setPasswd(char[] passwd)
Sets the data encryption password for this PKCS12Safe. By default, the parent PKCS12's password is used.

getPassword

public java.lang.String getPassword()
Deprecated. Use getPasswd()
Returns the data encryption password for this PKCS12Safe. By default, the parent PKCS12's password is used.

getPasswd

public char[] getPasswd()
Returns the data encryption password for this PKCS12Safe. By default, the parent PKCS12's password is used.
Returns:

getBags

public java.util.Vector<PKCS12Bag> getBags()
Deprecated. Use getBagsAsList()
Returns the vector of PKCS12Bags contained in this safe.

getBagsAsList

public java.util.ArrayList<PKCS12Bag> getBagsAsList()
Returns the ArrayList of PKCS12Bags contained in this safe.

setBags

public void setBags(java.util.Vector<PKCS12Bag> bags)
Deprecated. Use setBags(List)

setBags

public void setBags(java.util.List<PKCS12Bag> bags)

addBag

public void addBag(PKCS12Bag b)

getMode

public int getMode()
Get the encryption mode used for this safe. Uses one of the constants in PKCS5.

setMode

public void setMode(int mode)

setPBEOID

public void setPBEOID(oracle.security.crypto.asn1.ASN1ObjectID pbeOID)

getPBEOID

public oracle.security.crypto.asn1.ASN1ObjectID getPBEOID()

toString

public java.lang.String toString()
Returns a string representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this object

writeExternal

public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

Skip navigation links

Oracle Fusion Middleware Security Engine Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10674-03


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