The EnvelopedCms.Encode method encodes the contents of the enveloped CMS/PKCS #7 message and returns it as an array of byte values. Encryption must be done before encoding.
![]()
If the method succeeds, the method returns an array of byte values that represent the encoded information.
If the method fails, it throws an exception.
EnvelopedCms.Encrypt or another erload:System.Security.Cryptography.Pkcs.EnvelopedCms.Encrypt method must be called before this method.
The EnvelopedCms.Encode method does not cause the EnvelopedCms.RecipientInfos property to be populated.