Bouncy Castle Cryptography Library 1.47

org.bouncycastle.pkcs
Class PKCS12PfxPdu

java.lang.Object
  extended by org.bouncycastle.pkcs.PKCS12PfxPdu

public class PKCS12PfxPdu
extends java.lang.Object

A holding class for the PKCS12 Pfx structure.


Constructor Summary
PKCS12PfxPdu(org.bouncycastle.asn1.pkcs.Pfx pfx)
           
 
Method Summary
 org.bouncycastle.asn1.pkcs.ContentInfo[] getContentInfos()
          Return the content infos in the AuthenticatedSafe contained in this Pfx.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PKCS12PfxPdu

public PKCS12PfxPdu(org.bouncycastle.asn1.pkcs.Pfx pfx)
Method Detail

getContentInfos

public org.bouncycastle.asn1.pkcs.ContentInfo[] getContentInfos()
Return the content infos in the AuthenticatedSafe contained in this Pfx.

Returns:
an array of ContentInfo.

hasMac

public boolean hasMac()
Return whether or not there is MAC attached to this file.

Returns:
true if there is, false otherwise.

isMacValid

public boolean isMacValid(PKCS12MacCalculatorBuilderProvider macCalcProviderBuilder,
                          char[] password)
                   throws PKCSException
Verify the MacData attached to the PFX is consistent with what is expected.

Parameters:
macCalcProviderBuilder - provider builder for the calculator for the MAC
password - password to use
Returns:
true if mac data is valid, false otherwise.
Throws:
PKCSException - if there is a problem evaluating the MAC.
java.lang.IllegalStateException - if no MAC is actually present

toASN1Structure

public org.bouncycastle.asn1.pkcs.Pfx toASN1Structure()
Return the underlying ASN.1 object.

Returns:
a Pfx object.

Bouncy Castle Cryptography Library 1.47