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
)

Parameters

appName
Type: System.String

The name of the application.

primaryPurpose
Type: System.String

The primary purpose for the data protector.

specificPurpose
Type: System.String[]

The specific purpose(s) for the data protector.

ExceptionCondition
ArgumentException

appName is an empty string or null.

-or-

primaryPurpose is an empty string or null.

-or-

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

Show:
© 2015 Microsoft