MachineKeySection.DataProtectorType Property

.NET Framework (current version)

The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets the name of the data protector type. The default is String.Empty.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

[ConfigurationPropertyAttribute("dataProtectorType", DefaultValue = "")]
public string DataProtectorType { get; set; }

Property Value

Type: System.String

The name of the data protector type.

To specify custom data protection algorithms for ASP.NET, set the MachineKeySection.CompatibilityMode property to Framework45 and set this property to a string that represents a class that derives from the DataProtector class. This string corresponds to the providerClass parameter that is passed to the static DataProtector.Create factory method. The class you specify is used by the MachineKey.Protect and MachineKey.Unprotect methods even if you do not specify the Framework45 option.

If you set this property, you must also set the ApplicationName property.

.NET Framework
Available since 4.5
Return to top