public class PKCS12Safe
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object, java.io.Externalizable
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.
KeyPairPKCS12, PKCS12, PKCS12Bag, PKCS12CertBag, PKCS12ShroudedKeyBag, PKCS5, Serialized Form| Constructor and Description |
|---|
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
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
setPBEOID(oracle.security.crypto.asn1.ASN1ObjectID pbeOID) |
void |
setPBES2Parameters(oracle.security.crypto.asn1.ASN1ObjectID pbeOID, oracle.security.crypto.core.AlgorithmIdentifier prfAlgID, oracle.security.crypto.core.AlgorithmIdentifier cipherAlgID) |
java.lang.String |
toString()
Returns a string representation of this object.
|
void |
writeExternal(java.io.ObjectOutput os) |
public PKCS12Safe()
public PKCS12Safe(PKCS12 parent)
public PKCS12Safe(PKCS12 parent, int mode)
public PKCS12Safe(PKCS12 parent, oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
public PKCS12Safe(PKCS12 parent, java.io.InputStream is) throws java.io.IOException
java.io.IOExceptionpublic PKCS12Safe(PKCS12 parent, oracle.security.crypto.asn1.ASN1Sequence s) throws java.io.IOException
java.io.IOException
public void input(java.io.InputStream is)
throws java.io.IOException
input in interface oracle.security.crypto.util.Streamableis - the input stream from which this object will be readjava.io.IOException
public void input(oracle.security.crypto.asn1.ASN1Sequence s)
throws java.io.IOException
s - the ASN.1 sequence representation of this objectjava.io.IOException
public void output(java.io.OutputStream os)
throws java.io.IOException
output in interface oracle.security.crypto.util.Streamableos - the output stream to which the object will be writtenjava.io.IOExceptionpublic int length()
length in interface oracle.security.crypto.util.Streamablepublic void setPassword(java.lang.String passwd)
setPasswd(char[])PKCS12Safe. By default, the parent PKCS12's password is used.public void setPasswd(char[] passwd)
PKCS12Safe. By default, the parent PKCS12's password is used.public java.lang.String getPassword()
getPasswd()PKCS12Safe. By default, the parent PKCS12's password is used.public char[] getPasswd()
PKCS12Safe. By default, the parent PKCS12's password is used.public java.util.Vector<PKCS12Bag> getBags()
getBagsAsList()PKCS12Bags contained in this safe.public java.util.ArrayList<PKCS12Bag> getBagsAsList()
PKCS12Bags contained in this safe.public void setBags(java.util.Vector<PKCS12Bag> bags)
setBags(List)public void setBags(java.util.List<PKCS12Bag> bags)
public void addBag(PKCS12Bag b)
public int getMode()
PKCS5.public void setMode(int mode)
public void setPBEOID(oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
public void setPBES2Parameters(oracle.security.crypto.asn1.ASN1ObjectID pbeOID,
oracle.security.crypto.core.AlgorithmIdentifier prfAlgID,
oracle.security.crypto.core.AlgorithmIdentifier cipherAlgID)
public oracle.security.crypto.asn1.ASN1ObjectID getPBEOID()
public java.lang.String toString()
toString in class java.lang.Object
public void writeExternal(java.io.ObjectOutput os)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
public void readExternal(java.io.ObjectInput is)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundException