Export (0) Print
Expand All

DpapiDataProtector Constructor

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

public DpapiDataProtector(
	string appName,
	string primaryPurpose,
	params string[] specificPurpose


Type: System.String

The name of the application.

Type: System.String

The primary purpose for the data protector.

Type: System.String[]

The specific purpose(s) for the data protector.


appName is an empty string or null.


primaryPurpose is an empty string or null.


specificPurposes contains an empty string or null.

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

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft