Skip navigation links

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

E10674-04


oracle.security.crypto.cert
Class KeyPairPKCS12

java.lang.Object
  extended by oracle.security.crypto.cert.PKCS12
      extended by oracle.security.crypto.cert.KeyPairPKCS12

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

public class KeyPairPKCS12
extends PKCS12

A subclass of PKCS12 for processing exported key pairs, including PKCS12 object exported from Web browsers such as Netscape Navigator and Microsoft IE.

See Also:
Serialized Form

Constructor Summary
KeyPairPKCS12()
          Creates a new empty instance.
KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.List<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID, java.lang.String friendlyName)
          Make a PKCS12 object containing the given certificate chain and private key.
KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
          Deprecated. Use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String)
KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID, java.lang.String friendlyName)
          Deprecated. Use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String)
KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, int mode)
          Deprecated. use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID) instead
KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, int mode, java.lang.String friendlyName)
          Deprecated. use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String) instead
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.asn1.ASN1Sequence s)
           
KeyPairPKCS12(java.lang.String passwd, java.io.InputStream is)
           
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.List<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID, java.lang.String friendlyName)
          Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
          Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String) instead
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, oracle.security.crypto.asn1.ASN1ObjectID pbeOID, java.lang.String friendlyName)
          Deprecated. KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String)
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, int mode)
          Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID) instead
KeyPairPKCS12(java.lang.String passwd, oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8, java.util.Vector<X509> certChain, int mode, java.lang.String friendlyName)
          Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String) instead

 

Method Summary
 X509 getBottomCert()
           
 java.util.Vector<X509> getCertificateChain()
          Deprecated. 
 java.util.ArrayList<X509> getCertificateChainAsList()
          Gets the certificate chain from this KeyPairPKCS12 in order from bottom to top.
 oracle.security.crypto.core.PrivateKey getPrivateKey()
          Decrypts the PrivateKeyPKCS8 enclosed in this KeyPairPKCS12's PKCS12ShroudedKeyBag, using the password set for it (default is the parent PKCS12's password).
 oracle.security.crypto.core.PrivateKey getPrivateKey(java.lang.String passwd)
          Decrypts the PrivateKeyPKCS8 enclosed in this KeyPairPKCS12's PKCS12ShroudedKeyBag, using the given password.
 oracle.security.crypto.core.PrivateKeyPKCS8 getPrivateKeyPKCS8()
           
 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.

 

Methods inherited from class oracle.security.crypto.cert.PKCS12
addAuthSafe, getAuthSafes, getAuthSafesAsList, getPasswd, getPassword, length, output, readExternal, setAuthSafes, setAuthSafes, setPasswd, setPassword, toString, verify, writeExternal

 

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

 

Constructor Detail

KeyPairPKCS12

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

KeyPairPKCS12

public KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     int mode)
Deprecated. use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID) instead
Make a PKCS12 object containing the given certificate chain and private key.
Parameters:
pkcs8 - a PKCS8 private key
certChain - a vector of X509 certificates
mode - the encryption mode for the certificate chain (use constants from PKCS5)

KeyPairPKCS12

public KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
Deprecated. Use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String)
Make a PKCS12 object containing the given certificate chain and private key.
Parameters:
pkcs8 - a PKCS8 private key
certChain - a List of X509 certificates
pbeOID - the encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier)

KeyPairPKCS12

public KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     int mode,
                     java.lang.String friendlyName)
Deprecated. use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String) instead
Make a PKCS12 object containing the given certificate chain and private key.
Parameters:
pkcs8 - A PKCS8 private key.
certChain - A List of X509 certificates.
mode - The encryption mode for the certificate chain (use constants from PKCS5).
friendlyName - Friendly name for the key and bottom certificate.

KeyPairPKCS12

public KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID,
                     java.lang.String friendlyName)
Deprecated. Use KeyPairPKCS12(PrivateKeyPKCS8, List, ASN1ObjectID, String)
Make a PKCS12 object containing the given certificate chain and private key.
Parameters:
pkcs8 - A PKCS8 private key.
certChain - A List of X509 certificates.
pbeOID - The encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier).
friendlyName - Friendly name for the key and bottom certificate.

KeyPairPKCS12

public KeyPairPKCS12(oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.List<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID,
                     java.lang.String friendlyName)
Make a PKCS12 object containing the given certificate chain and private key.
Parameters:
pkcs8 - A PKCS8 private key.
certChain - A List of X509 certificates.
pbeOID - The encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier).
friendlyName - Friendly name for the key and bottom certificate.

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     int mode)
Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID) instead
Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
Parameters:
passwd - the encryption password
pkcs8 - a PKCS8 private key
certChain - a List of X509 certificates
mode - the encryption mode for the certificate chain (use constants from PKCS5)

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID)
Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String) instead
Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
Parameters:
passwd - the encryption password
pkcs8 - a PKCS8 private key
certChain - a List of X509 certificates
mode - the encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier)

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     int mode,
                     java.lang.String friendlyName)
Deprecated. use KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String) instead
Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
Parameters:
passwd - the encryption password
pkcs8 - a PKCS8 private key
certChain - a vector of X509 certificates
mode - the encryption mode for the certificate chain (use constants from PKCS5)
friendlyName - friendly name for the key and bottom certificate

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.Vector<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID,
                     java.lang.String friendlyName)
Deprecated. KeyPairPKCS12(String, PrivateKeyPKCS8, List, ASN1ObjectID, String)
Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
Parameters:
passwd - the encryption password
pkcs8 - a PKCS8 private key
certChain - a vector of X509 certificates
mode - the encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier)
friendlyName - friendly name for the key and bottom certificate

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.core.PrivateKeyPKCS8 pkcs8,
                     java.util.List<X509> certChain,
                     oracle.security.crypto.asn1.ASN1ObjectID pbeOID,
                     java.lang.String friendlyName)
Make a PKCS12 object encrypted with the specified password, and containing the given certificate chain and private key.
Parameters:
passwd - the encryption password
pkcs8 - a PKCS8 private key
certChain - a List of X509 certificates
mode - the encryption mode for the certificate chain (use constants from oracle.security.crypto.core.PBEAlgorithmIdentifier)
friendlyName - friendly name for the key and bottom certificate

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     java.io.InputStream is)
              throws java.io.IOException
Throws:
java.io.IOException

KeyPairPKCS12

public KeyPairPKCS12(java.lang.String passwd,
                     oracle.security.crypto.asn1.ASN1Sequence s)
              throws java.io.IOException
Throws:
java.io.IOException

Method Detail

input

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

input

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

getPrivateKeyPKCS8

public oracle.security.crypto.core.PrivateKeyPKCS8 getPrivateKeyPKCS8()

getPrivateKey

public oracle.security.crypto.core.PrivateKey getPrivateKey()
Decrypts the PrivateKeyPKCS8 enclosed in this KeyPairPKCS12's PKCS12ShroudedKeyBag, using the password set for it (default is the parent PKCS12's password).
See Also:
getPrivateKey(String passwd)

getPrivateKey

public oracle.security.crypto.core.PrivateKey getPrivateKey(java.lang.String passwd)
Decrypts the PrivateKeyPKCS8 enclosed in this KeyPairPKCS12's PKCS12ShroudedKeyBag, using the given password.
See Also:
getPrivateKey()

getCertificateChain

@Deprecated
public java.util.Vector<X509> getCertificateChain()
Deprecated. 
Gets the certificate chain from this KeyPairPKCS12 in order from bottom to top.
Returns:
a Vector of X509 certificates (possibly empty), or null if this KeyPairPKCS12 was not constructed from an input stream.

getCertificateChainAsList

public java.util.ArrayList<X509> getCertificateChainAsList()
Gets the certificate chain from this KeyPairPKCS12 in order from bottom to top.
Returns:
a ArrayList of X509 certificates (possibly empty), or null if this KeyPairPKCS12 was not constructed from an input stream.

getBottomCert

public X509 getBottomCert()

Skip navigation links

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

E10674-04


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