FileDocCategorySizeDatePackage
Pfx.javaAPI DocAndroid 1.5 API1603Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.pkcs

Pfx

public class Pfx extends org.bouncycastle.asn1.ASN1Encodable implements PKCSObjectIdentifiers
the infamous Pfx from PKCS12

Fields Summary
private ContentInfo
contentInfo
private MacData
macData
Constructors Summary
public Pfx(org.bouncycastle.asn1.ASN1Sequence seq)


     
           
    
        BigInteger  version = ((DERInteger)seq.getObjectAt(0)).getValue();
        if (version.intValue() != 3)
        {
            throw new IllegalArgumentException("wrong version for PFX PDU");
        }

        contentInfo = ContentInfo.getInstance(seq.getObjectAt(1));

        if (seq.size() == 3)
        {
            macData = MacData.getInstance(seq.getObjectAt(2));
        }
    
public Pfx(ContentInfo contentInfo, MacData macData)

        this.contentInfo = contentInfo;
        this.macData = macData;
    
Methods Summary
public ContentInfogetAuthSafe()

        return contentInfo;
    
public MacDatagetMacData()

        return macData;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()

        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(new DERInteger(3));
        v.add(contentInfo);

        if (macData != null)
        {
            v.add(macData);
        }

        return new BERSequence(v);