SignedCms.Decode Method
.NET Framework 3.0
The Decode method decodes an encoded SignedCms message. Upon successful decoding, the decoded information can be retrieved from the properties of the SignedCms object.
Namespace: System.Security.Cryptography.Pkcs
Assembly: System.Security (in system.security.dll)
Assembly: System.Security (in system.security.dll)
The following example shows the placement of the Decode method in the process of verifying the signatures on a SignedCms message. In this example, the message content is not detached, so the message content is included in the SignedCms message.
// Create a new, nondetached SignedCms message. SignedCms signedCms = new SignedCms(); // encodedMessage is the encoded message received from // the sender. signedCms.Decode(encodedMessage); // Verify the signature without validating the // certificate. signedCms.CheckSignature(true);
The following example shows the placement of the Decode method in the process of verifying the signatures on a SignedCms message. In this example, the message content is detached, so the message content must be verified independently of the SignedCms message.
// Create a ContentInfo object from the inner content obtained // independently from encodedMessage. ContentInfo contentInfo = new ContentInfo(innerContent); // Create a new, detached SignedCms message. SignedCms signedCms = new SignedCms(contentInfo, true); // encodedMessage is the encoded message received from // the sender. signedCms.Decode(encodedMessage); // Verify the signature without validating the // certificate. signedCms.CheckSignature(true);
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.