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 PKCS12Safe

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

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

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

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`

Constructor Summary
`PKCS12Safe(PKCS12 parent)`
`PKCS12Safe(PKCS12 parent, oracle.security.crypto.asn1.ASN1Sequence s)`
`PKCS12Safe(PKCS12 parent, java.io.InputStream is)`
`PKCS12Safe(PKCS12 parent, int mode)`

Method Summary
`void` | `addBag(PKCS12Bag b)`
`java.util.Vector` | `getBags()` Returns the vector of `PKCS12Bag`s contained in this safe.
`int` | `getMode()` Get the encryption mode used for this safe.
`java.lang.String` | `getPassword()` Returns the data encryption password for this `PKCS12Safe`.
`oracle.security.crypto.core.PKCS5` | `getPKCS5()`
`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` | `setBags(java.util.Vector b)`
`void` | `setMode(int mode)`
`void` | `setPassword(java.lang.String passwd)` Sets the data encryption password for this `PKCS12Safe`.
`java.lang.String` | `toString()` Returns a string representation of this object.

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

Constructor Detail

### PKCS12Safe

    public PKCS12Safe(PKCS12 parent)

### PKCS12Safe

    public PKCS12Safe(PKCS12 parent,
                      int mode)

### PKCS12Safe

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

### PKCS12Safe

    public PKCS12Safe(PKCS12 parent,
                      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

### setPassword

    public void setPassword(java.lang.String passwd)

  Sets the data encryption password for this `PKCS12Safe`. By default, the parent `PKCS12`'s password is used.

### getPassword

    public java.lang.String getPassword()

  Returns the data encryption password for this `PKCS12Safe`. By default, the parent `PKCS12`'s password is used.

### getBags

    public java.util.Vector getBags()

  Returns the vector of `PKCS12Bag`s contained in this safe.

### setBags

    public void setBags(java.util.Vector b)

### 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`.
  See Also:
    `PKCS5`

### setMode

    public void setMode(int mode)

### getPKCS5

    public oracle.security.crypto.core.PKCS5 getPKCS5()

### 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.