MachineKeySection.ValidationAlgorithm Property

Definition

Gets or sets the name of the algorithm that is used to validate forms authentication and view state data.

public:
 property System::String ^ ValidationAlgorithm { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))]
[System.Configuration.ConfigurationProperty("validation", DefaultValue="HMACSHA256")]
[System.Configuration.StringValidator(MinLength=1)]
public string ValidationAlgorithm { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Configuration.WhiteSpaceTrimStringConverter))>]
[<System.Configuration.ConfigurationProperty("validation", DefaultValue="HMACSHA256")>]
[<System.Configuration.StringValidator(MinLength=1)>]
member this.ValidationAlgorithm : string with get, set
Public Property ValidationAlgorithm As String

Property Value

A string that contains the name of a predefined algorithm or the name of a custom algorithm.

Attributes

Remarks

The predefined algorithms that are available are defined by the MachineKeyValidation enumeration. If you want to use a custom algorithm, you do not have to set this property. Set the Validation property to the name of the custom algorithm. When you do that, this property will automatically be set to Custom.

You can set the ValidationAlgorithm property declaratively in the Web.config file or programmatically in code.

To set this property declaratively, you use the validationAlgorithm attribute of the machineKey element in the configuration file. This attribute can be set to the name of a predefined algorithm or of a custom algorithm. The predefined algorithms are defined by the