Bouncy Castle Cryptography Library 1.85

org.bouncycastle.pkcs
Class PKCS12SafeBagFactory

java.lang.Object
  extended byorg.bouncycastle.pkcs.PKCS12SafeBagFactory

public class PKCS12SafeBagFactory
extends java.lang.Object

Factory that materialises the PKCS12SafeBags carried in one ContentInfo of a PFX's AuthenticatedSafe. Use the single-argument constructor for plain content infos and the two-argument constructor with an InputDecryptorProvider for content infos.


Constructor Summary
PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info)
          Construct a factory over a plain (unencrypted) ContentInfo.
PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info, InputDecryptorProvider inputDecryptorProvider)
          Construct a factory over an ContentInfo, decrypting its contents with the supplied provider.
 
Method Summary
 PKCS12SafeBag[] getSafeBags()
          Return the PKCS12SafeBags contained in the ContentInfo this factory was created over.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS12SafeBagFactory

public PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info)
Construct a factory over a plain (unencrypted) ContentInfo.

Parameters:
info - the ContentInfo holding the SafeContents.
Throws:
java.lang.IllegalArgumentException - if is an ContentInfo.

PKCS12SafeBagFactory

public PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info,
                            InputDecryptorProvider inputDecryptorProvider)
                     throws PKCSException
Construct a factory over an ContentInfo, decrypting its contents with the supplied provider.

Parameters:
info - the encrypted ContentInfo.
inputDecryptorProvider - provider able to produce a decryptor matching the algorithm identifier carried by .
Throws:
PKCSException - if decryption fails.
java.lang.IllegalArgumentException - if is not an ContentInfo.
Method Detail

getSafeBags

public PKCS12SafeBag[] getSafeBags()
Return the PKCS12SafeBags contained in the ContentInfo this factory was created over.

Returns:
the SafeBags as an array.

Bouncy Castle Cryptography Library 1.85