System.Security.Cryptography.Pkcs.EnvelopedCms.Encode Method

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.

Syntax

public byte[] Encode ()

Returns

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.

Remarks

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.

Requirements

Namespace: System.Security.Cryptography.Pkcs
Assembly: System.Security (in System.Security.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0