Org.BouncyCastle.Asn1.Cms.AuthEnvelopedData.AuthEnvelopedData C# (CSharp) Method

AuthEnvelopedData() private method

private AuthEnvelopedData ( Asn1Sequence seq ) : System
seq Asn1Sequence
return System
		private AuthEnvelopedData(
			Asn1Sequence	seq)
		{
			int index = 0;

			// TODO
			// "It MUST be set to 0."
			Asn1Object tmp = seq[index++].ToAsn1Object();
			version = (DerInteger)tmp;

			tmp = seq[index++].ToAsn1Object();
			if (tmp is Asn1TaggedObject)
			{
				originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject)tmp, false);
				tmp = seq[index++].ToAsn1Object();
			}

			// TODO
			// "There MUST be at least one element in the collection."
			recipientInfos = Asn1Set.GetInstance(tmp);

			tmp = seq[index++].ToAsn1Object();
			authEncryptedContentInfo = EncryptedContentInfo.GetInstance(tmp);

			tmp = seq[index++].ToAsn1Object();
			if (tmp is Asn1TaggedObject)
			{
				authAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false);
				tmp = seq[index++].ToAsn1Object();
			}
			else
			{
				// TODO
				// "The authAttrs MUST be present if the content type carried in
				// EncryptedContentInfo is not id-data."
			}

			mac = Asn1OctetString.GetInstance(tmp);

			if (seq.Count > index)
			{
				tmp = seq[index++].ToAsn1Object();
				unauthAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false);
			}
		}

Same methods

AuthEnvelopedData::AuthEnvelopedData ( OriginatorInfo originatorInfo, Asn1Set recipientInfos, EncryptedContentInfo authEncryptedContentInfo, Asn1Set authAttrs, Asn1OctetString mac, Asn1Set unauthAttrs ) : System