Redigera

Dela via


DataProtector(String, String, String[]) Constructor

Definition

Creates a new instance of the DataProtector class by using the provided application name, primary purpose, and specific purposes.

protected:
 DataProtector(System::String ^ applicationName, System::String ^ primaryPurpose, cli::array <System::String ^> ^ specificPurposes);
protected DataProtector (string applicationName, string primaryPurpose, string[] specificPurposes);
new System.Security.Cryptography.DataProtector : string * string * string[] -> System.Security.Cryptography.DataProtector
Protected Sub New (applicationName As String, primaryPurpose As String, specificPurposes As String())

Parameters

applicationName
String

The name of the application.

primaryPurpose
String

The primary purpose for the protected data.

specificPurposes
String[]

The specific purposes for the protected data.

Exceptions

applicationName is an empty string or null.

-or-

primaryPurpose is an empty string or null.

-or-

specificPurposes contains an empty string or null.

Remarks

This constructor sets the ApplicationName, PrimaryPurpose, and SpecificPurposes properties. The combination of these three properties must uniquely identify the data you are protecting. If the data is not uniquely identified, you might inadvertently read the wrong data, or other data might be substituted for yours. Examples of primary and specific purpose pairs are "invoice" and invoice number, "gift card" and gift card number, "password" and URL string.

Applies to