ASN1InputStream aIn = new ASN1InputStream(cert.getTBSCertificate());
TBSCertificateStructure tbs = TBSCertificateStructure.getInstance(aIn.readObject());
IssuerAndSerialNumber encSid = new IssuerAndSerialNumber(tbs.getIssuer(), tbs.getSerialNumber().getValue());
return new RecipientInfo(new KeyTransRecipientInfo(
new RecipientIdentifier(encSid),
keyEncAlg,
encKey));
}
else
{
return new RecipientInfo(new KeyTransRecipientInfo(
new RecipientIdentifier(subKeyId),
keyEncAlg,
encKey));
}
}
else if (originator != null)