DpapiDataProtector Constructor (String^, String^, array<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 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,
	... array<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: array<System::String^>^

The specific purpose(s) for the data protector.

Exception Condition
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>.

DataProtectionPermission

for protecting data. Security action: Demand. Associated enumeration: Unrestricted.

.NET Framework
Available since 4.5
Return to top
Show: