public class PKCS12
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object, java.io.Externalizable
A PKCS12 object may contain multiple authenticated safes (represented as PKCS12Safe objects). Each authenticated safe may have its own encryption method, and contains a number of bags (represented as instances of PKCS12Bag). Note: the methods and constructors that input a PKCS12 object do not automatically check the validity of the MAC. You need to explicitly call verify() to make this check.
KeyPairPKCS12, PKCS12Safe, PKCS12Bag, PKCS12CertBag, PKCS12ShroudedKeyBag, Serialized Form| Constructor and Description |
|---|
PKCS12() |
PKCS12(java.io.InputStream is) |
PKCS12(java.lang.String passwd, oracle.security.crypto.asn1.ASN1Sequence s) |
PKCS12(java.lang.String passwd, java.io.InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAuthSafe(PKCS12Safe s) |
java.util.Vector<PKCS12Safe> |
getAuthSafes()
Deprecated.
|
java.util.ArrayList<PKCS12Safe> |
getAuthSafesAsList()
Get the List of authenticated safes, represented as
PKCS12Safe objects. |
char[] |
getPasswd()
Get the password
|
java.lang.String |
getPassword()
Deprecated.
use
getPasswd() |
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 |
setAuthSafes(java.util.List<PKCS12Safe> authSafes) |
void |
setAuthSafes(java.util.Vector<PKCS12Safe> authSafes)
Deprecated.
|
void |
setPasswd(char[] pw)
Set the password
|
void |
setPassword(java.lang.String pw)
Deprecated.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
boolean |
verify()
Verifies the MAC.
|
void |
writeExternal(java.io.ObjectOutput os) |
public PKCS12()
public PKCS12(java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public PKCS12(java.lang.String passwd,
java.io.InputStream is)
throws java.io.IOException
java.io.IOException
public PKCS12(java.lang.String passwd,
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 read.java.io.IOException
public void input(oracle.security.crypto.asn1.ASN1Sequence s)
throws java.io.IOException
s - The ASN.1 sequence representation of this object.java.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 java.lang.String getPassword()
getPasswd()public char[] getPasswd()
public void setPassword(java.lang.String pw)
setPasswd(char[])pw -public void setPasswd(char[] pw)
pw -public java.util.Vector<PKCS12Safe> getAuthSafes()
getAuthSafesAsList()PKCS12Safe objects.public java.util.ArrayList<PKCS12Safe> getAuthSafesAsList()
PKCS12Safe objects.public void setAuthSafes(java.util.Vector<PKCS12Safe> authSafes)
setAuthSafes(List)public void setAuthSafes(java.util.List<PKCS12Safe> authSafes)
public void addAuthSafe(PKCS12Safe s)
public boolean verify()
throws oracle.security.crypto.core.AuthenticationException
oracle.security.crypto.core.AuthenticationExceptionpublic 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