Export (0) Print
Expand All

EnvelopedCms.Decrypt Method (RecipientInfo, X509Certificate2Collection)

The Decrypt(RecipientInfo, X509Certificate2Collection) method decrypts the contents of the decoded enveloped CMS/PKCS #7 message by using the private key associated with the certificate identified by the specified recipient information and by using the specified certificate collection. The Decrypt(RecipientInfo, X509Certificate2Collection) method searches the specified certificate collection and the My certificate store for the proper certificate to use for the decryption.

Namespace:  System.Security.Cryptography.Pkcs
Assembly:  System.Security (in System.Security.dll)

public void Decrypt(
	RecipientInfo recipientInfo,
	X509Certificate2Collection extraStore
)

Parameters

recipientInfo
Type: System.Security.Cryptography.Pkcs.RecipientInfo

A RecipientInfo object that represents the recipient information to use for the decryption.

extraStore
Type: System.Security.Cryptography.X509Certificates.X509Certificate2Collection

An X509Certificate2Collection collection that represents additional certificates to use for the decryption. The Decrypt(RecipientInfo, X509Certificate2Collection) method searches this certificate collection and the My certificate store for the proper certificate to use for the decryption.

ExceptionCondition
ArgumentNullException

A null reference was passed to a method that does not accept it as a valid argument.

CryptographicException

A cryptographic operation could not be completed.

InvalidOperationException

A method call was invalid for the object's current state.

.NET Framework Security

The following permissions are required to access the decryption key:

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft