Package org.bouncycastle.pkcs
Class PKCS12SafeBagFactory
- java.lang.Object
-
- org.bouncycastle.pkcs.PKCS12SafeBagFactory
-
public class PKCS12SafeBagFactory extends java.lang.ObjectFactory that materialises thePKCS12SafeBags carried in oneContentInfoof a PFX's AuthenticatedSafe. Use the single-argument constructor for plaindatacontent infos and the two-argument constructor with anInputDecryptorProviderforencryptedDatacontent infos.
-
-
Constructor Summary
Constructors Constructor Description PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info)Construct a factory over a plain (unencrypted)dataContentInfo.PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info, InputDecryptorProvider inputDecryptorProvider)Construct a factory over anencryptedDataContentInfo, decrypting its contents with the supplied provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PKCS12SafeBag[]getSafeBags()Return thePKCS12SafeBags contained in the ContentInfo this factory was created over.
-
-
-
Constructor Detail
-
PKCS12SafeBagFactory
public PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info)
Construct a factory over a plain (unencrypted)dataContentInfo.- Parameters:
info- the ContentInfo holding the SafeContents.- Throws:
java.lang.IllegalArgumentException- ifinfois anencryptedDataContentInfo.
-
PKCS12SafeBagFactory
public PKCS12SafeBagFactory(org.bouncycastle.asn1.pkcs.ContentInfo info, InputDecryptorProvider inputDecryptorProvider) throws PKCSExceptionConstruct a factory over anencryptedDataContentInfo, decrypting its contents with the supplied provider.- Parameters:
info- the encrypted ContentInfo.inputDecryptorProvider- provider able to produce a decryptor matching the algorithm identifier carried byinfo.- Throws:
PKCSException- if decryption fails.java.lang.IllegalArgumentException- ifinfois not anencryptedDataContentInfo.
-
-
Method Detail
-
getSafeBags
public PKCS12SafeBag[] getSafeBags()
Return thePKCS12SafeBags contained in the ContentInfo this factory was created over.- Returns:
- the SafeBags as an array.
-
-