public class PKCS12PfxPdu
extends java.lang.Object
| Constructor and Description |
|---|
PKCS12PfxPdu(byte[] pfx)
Parse a BER/DER encoded PFX from a byte array.
|
PKCS12PfxPdu(org.bouncycastle.asn1.pkcs.Pfx pfx)
Wrap an existing parsed PFX ASN.1 structure.
|
| Modifier and Type | Method and Description |
|---|---|
org.bouncycastle.asn1.pkcs.ContentInfo[] |
getContentInfos()
Return the content infos in the AuthenticatedSafe contained in this Pfx.
|
byte[] |
getEncoded()
Return the default (BER) encoding of the PFX.
|
byte[] |
getEncoded(java.lang.String encoding)
Return a Pfx with the outer wrapper encoded as asked for.
|
org.bouncycastle.asn1.x509.AlgorithmIdentifier |
getMacAlgorithmID()
Return the algorithm identifier describing the MAC algorithm
|
boolean |
hasMac()
Return whether or not there is MAC attached to this file.
|
boolean |
isMacValid(PKCS12MacCalculatorBuilderProvider macCalcProviderBuilder,
char[] password)
Verify the MacData attached to the PFX is consistent with what is expected.
|
org.bouncycastle.asn1.pkcs.Pfx |
toASN1Structure()
Return the underlying ASN.1 object.
|
public PKCS12PfxPdu(org.bouncycastle.asn1.pkcs.Pfx pfx)
pfx - the PFX to wrap.public PKCS12PfxPdu(byte[] pfx)
throws java.io.IOException
pfx - the encoded PFX bytes.java.io.IOException - if the data is not a valid PFX encoding.public org.bouncycastle.asn1.pkcs.ContentInfo[] getContentInfos()
public boolean hasMac()
public org.bouncycastle.asn1.x509.AlgorithmIdentifier getMacAlgorithmID()
public boolean isMacValid(PKCS12MacCalculatorBuilderProvider macCalcProviderBuilder, char[] password) throws PKCSException
macCalcProviderBuilder - provider builder for the calculator for the MACpassword - password to usePKCSException - if there is a problem evaluating the MAC.java.lang.IllegalStateException - if no MAC is actually presentpublic org.bouncycastle.asn1.pkcs.Pfx toASN1Structure()
public byte[] getEncoded()
throws java.io.IOException
java.io.IOException - if encoding fails.public byte[] getEncoded(java.lang.String encoding)
throws java.io.IOException
getEncoded(ASN1Encoding.DL)
encoding - encoding style (ASN1Encoding.DER, ASN1Encoding.DL, ASN1Encoding.BER)java.io.IOException