Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DataProtector Constructor
Collapse the table of content
Expand the table of content

DataProtector Constructor

.NET Framework 4.6 and 4.5

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:
DataProtector(
	String^ applicationName, 
	String^ primaryPurpose, 
	array<String^>^ specificPurposes
)

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: array<System::String>

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

ExceptionCondition
ArgumentException

applicationName is an empty string or nullptr.

-or-

primaryPurpose is an empty string or nullptr.

-or-

specificPurposes contains an empty string or nullptr.

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

Supported in: 4.6, 4.5
Show:
© 2015 Microsoft