DataProtector Constructor (String, String, String())

.NET Framework (current version)
 
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.

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

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

Protected Sub New (
	applicationName As String,
	primaryPurpose As String,
	specificPurposes As String()
)

Parameters

applicationName
Type: System.String

The name of the application.

primaryPurpose
Type: System.String

The primary purpose for the protected data. See Remarks for additional important information.

specificPurposes
Type: System.String()

The specific purposes for the protected data. See Remarks for additional important information.

Exception Condition
ArgumentException

applicationName is an empty string or null.

-or-

primaryPurpose is an empty string or null.

-or-

specificPurposes contains an empty string or null.

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.

.NET Framework
Available since 4.5
Return to top
Show: