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

DpapiDataProtector Constructor

.NET Framework 4.6 and 4.5

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

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

	String^ appName, 
	String^ primaryPurpose, 
	... array<String^>^ specificPurpose


Type: System::String

The name of the application.

Type: System::String

The primary purpose for the data protector.

Type: array<System::String>

The specific purpose(s) for the data protector.


appName is an empty string or nullptr.


primaryPurpose is an empty string or nullptr.


specificPurposes contains an empty string or nullptr.

The application name specified by the appName parameter is considered to be a part of the purpose for the protected data. The three parameters are hashed, and the hash is used for both protecting and unprotecting the data. Examples of primaryPurpose and specificPurposes values are Giftcard and <gift card number> or Invoice and <invoice number>.

.NET Framework

Supported in: 4.6, 4.5

© 2015 Microsoft