Export (0) Print
Expand All

DataProtector Constructor

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

'Declaration
Protected Sub New ( _
	applicationName As String, _
	primaryPurpose As String, _
	specificPurposes As String() _
)

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: System.String()

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

ExceptionCondition
ArgumentException

applicationName is an empty string or Nothing.

-or-

primaryPurpose is an empty string or Nothing.

-or-

specificPurposes contains an empty string or Nothing.

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.5.2, 4.5.1, 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.

Show:
© 2014 Microsoft