use of org.bouncycastle.cms.PasswordRecipientInformation in project xipki by xipki.
the class PbmMacCmpCaClient method decrypt.
private byte[] decrypt(EnvelopedData ed0) throws Exception {
ContentInfo ci = new ContentInfo(CMSObjectIdentifiers.envelopedData, ed0);
CMSEnvelopedData ed = new CMSEnvelopedData(ci);
RecipientInformationStore recipients = ed.getRecipientInfos();
Iterator<RecipientInformation> it = recipients.getRecipients().iterator();
PasswordRecipientInformation recipient = (PasswordRecipientInformation) it.next();
return recipient.getContent(new BcPasswordEnvelopedRecipient(password));
}
Aggregations