EnvelopedCms.Decrypt Method (X509Certificate2Collection)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

The Decrypt(X509Certificate2Collection) method decrypts the contents of the decoded enveloped CMS/PKCS #7 message by using the specified certificate collection. The Decrypt(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(
	X509Certificate2Collection extraStore
)

Parameters

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

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

Exception Condition
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.

The following permissions are required to access the decryption key:

.NET Framework
Available since 2.0
Return to top
Show: