public CmsAuthenticatedDataParser(
Stream envelopedData)
: base(envelopedData)
{
this.authAttrNotRead = true;
this.authData = new AuthenticatedDataParser(
(Asn1SequenceParser)contentInfo.GetContent(Asn1Tags.Sequence));
// TODO Validate version?
//DerInteger version = this.authData.getVersion();
//
// read the recipients
//
Asn1Set recipientInfos = Asn1Set.GetInstance(authData.GetRecipientInfos().ToAsn1Object());
this.macAlg = authData.GetMacAlgorithm();
//
// read the authenticated content info
//
ContentInfoParser data = authData.GetEnapsulatedContentInfo();
CmsReadable readable = new CmsProcessableInputStream(
((Asn1OctetStringParser)data.GetContent(Asn1Tags.OctetString)).GetOctetStream());
CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsAuthenticatedSecureReadable(
this.macAlg, readable);
//
// build the RecipientInformationStore
//
this._recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore(
recipientInfos, secureReadable);
}