fail("no friendly name found on key");
}
if (b1.getBagAttribute(PKCSObjectIdentifiers.pkcs_9_at_localKeyId) != null)
{
ASN1OctetString id = (ASN1OctetString)b1.getBagAttribute(PKCSObjectIdentifiers.pkcs_9_at_localKeyId);
if (!id.equals(b2.getBagAttribute(PKCSObjectIdentifiers.pkcs_9_at_localKeyId)))
{
fail("local key id mismatch");
}
}
else
{
fail("no local key id found");
}
//
// check algorithm types.
//
ASN1InputStream aIn = new ASN1InputStream(bOut.toByteArray());
Pfx pfx = Pfx.getInstance(aIn.readObject());
ContentInfo cInfo = pfx.getAuthSafe();
ASN1OctetString auth = (ASN1OctetString)cInfo.getContent();
aIn = new ASN1InputStream(auth.getOctets());
ASN1Sequence s1 = (ASN1Sequence)aIn.readObject();
ContentInfo c1 = ContentInfo.getInstance(s1.getObjectAt(0));
ContentInfo c2 = ContentInfo.getInstance(s1.getObjectAt(1));