EnvelopedCms.Encrypt Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Encrypts the contents of the CMS/PKCS#7 message.
Encrypt() |
Encrypts the contents of the CMS/PKCS#7 message after selecting recipient certificates via a UI popup. |
Encrypt(CmsRecipient) |
Encrypts the contents of the CMS/PKCS#7 message for a single specified recipient. |
Encrypt(CmsRecipientCollection) |
Encrypts the contents of the CMS/PKCS#7 message for one or more recipients. |
Encrypts the contents of the CMS/PKCS#7 message after selecting recipient certificates via a UI popup.
public:
void Encrypt();
public void Encrypt ();
member this.Encrypt : unit -> unit
Public Sub Encrypt ()
Exceptions
A cryptographic operation could not be completed.
Remarks
This method displays a user interface in which you choose the recipients for whom to encrypt the message. This requires that the current process is running in user interactive mode, meaning that the Environment.UserInteractive property is true
. A process is normally in user interactive mode unless it is a service process or running inside a Web application.
The user interface will only present certificates that are within their validity period and that have Key Encipherment or Key Agreement included in their key usage.
The following permissions are required to display the user interface on .NET Framework:
Applies to
.NET Framework 4.8.1 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
Encrypts the contents of the CMS/PKCS#7 message for a single specified recipient.
public:
void Encrypt(System::Security::Cryptography::Pkcs::CmsRecipient ^ recipient);
public void Encrypt (System.Security.Cryptography.Pkcs.CmsRecipient recipient);
member this.Encrypt : System.Security.Cryptography.Pkcs.CmsRecipient -> unit
Public Sub Encrypt (recipient As CmsRecipient)
Parameters
- recipient
- CmsRecipient
The recipient information describing the single recipient of this message.
Exceptions
The recipient
parameter is null
.
A cryptographic operation could not be completed.
See also
Applies to
.NET 9 (package-provided) والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
- Source:
- EnvelopedCms.cs
Encrypts the contents of the CMS/PKCS#7 message for one or more recipients.
public:
void Encrypt(System::Security::Cryptography::Pkcs::CmsRecipientCollection ^ recipients);
public void Encrypt (System.Security.Cryptography.Pkcs.CmsRecipientCollection recipients);
member this.Encrypt : System.Security.Cryptography.Pkcs.CmsRecipientCollection -> unit
Public Sub Encrypt (recipients As CmsRecipientCollection)
Parameters
- recipients
- CmsRecipientCollection
A collection describing the recipients for the message.
Exceptions
The recipients
parameter is null
.
A cryptographic operation could not be completed.
Applies to
.NET 9 (package-provided) والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, 8 (package-provided), 9 (package-provided) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
ملاحظات .NET
.NET هو مشروع مصدر مفتوح. حدد رابطًا لتقديم الملاحظات: