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

ToAsn1Object() public method

public ToAsn1Object ( ) : Asn1Object
return Asn1Object
	    public override Asn1Object ToAsn1Object()
		{
			Asn1EncodableVector v = new Asn1EncodableVector(version);

			if (originatorInfo != null)
			{
				v.Add(new DerTaggedObject(false, 0, originatorInfo));
			}

			v.Add(recipientInfos, authEncryptedContentInfo);

			// "authAttrs optionally contains the authenticated attributes."
			if (authAttrs != null)
			{
				// "AuthAttributes MUST be DER encoded, even if the rest of the
				// AuthEnvelopedData structure is BER encoded."
				v.Add(new DerTaggedObject(false, 1, authAttrs));
			}

			v.Add(mac);

			// "unauthAttrs optionally contains the unauthenticated attributes."
			if (unauthAttrs != null)
			{
				v.Add(new DerTaggedObject(false, 2, unauthAttrs));
			}

			return new BerSequence(v);
		}
	}