Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Security Engine Java API Reference 10g Release 3 (10.1.3) B25381-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.cert
Class PKCS12

`java.lang.Object
oracle.security.crypto.cert.PKCS12`

All Implemented Interfaces:
  oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

Direct Known Subclasses:
  KeyPairPKCS12

public class PKCS12
extends java.lang.Object
implements oracle.security.crypto.asn1.ASN1Object

An implementation of PKCS #12 password encryption/integrity modes. Both input and output are implemented.

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.

See Also:
  `KeyPairPKCS12`, `PKCS12Safe`, `PKCS12Bag`, `PKCS12CertBag`, `PKCS12ShroudedKeyBag`

Constructor Summary
`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)`

Method Summary
`void` | `addAuthSafe(PKCS12Safe s)`
`java.util.Vector` | `getAuthSafes()` Get the vector of authenticated safes, represented as `PKCS12Safe` objects.
`java.lang.String` | `getPassword()`
`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` | `setAuthSafes(java.util.Vector authSafes)`
`void` | `setPassword(java.lang.String pw)`
`java.lang.String` | `toString()` Returns a string representation of this object.
`boolean` | `verify()` Verifies the MAC.

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

Constructor Detail

### PKCS12

    public PKCS12()

### PKCS12

    public PKCS12(java.io.InputStream is)
           throws java.io.IOException

### PKCS12

    public PKCS12(java.lang.String passwd,
                  java.io.InputStream is)
           throws java.io.IOException

### PKCS12

    public PKCS12(java.lang.String passwd,
                  oracle.security.crypto.asn1.ASN1Sequence s)
           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

### getPassword

    public java.lang.String getPassword()

### setPassword

    public void setPassword(java.lang.String pw)

### getAuthSafes

    public java.util.Vector getAuthSafes()

  Get the vector of authenticated safes, represented as `PKCS12Safe` objects.

### setAuthSafes

    public void setAuthSafes(java.util.Vector authSafes)

### addAuthSafe

    public void addAuthSafe(PKCS12Safe s)

### verify

    public boolean verify()
                   throws oracle.security.crypto.core.AuthenticationException

  Verifies the MAC.
  Throws:
    `oracle.security.crypto.core.AuthenticationException`

### toString

    public java.lang.String toString()

  Returns a string representation of this object.
  Returns:
    a string representation of this object

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Security Engine Java API Reference 10g Release 3 (10.1.3) B25381-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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