FormsAuthPasswordFormat FormsAuthPasswordFormat FormsAuthPasswordFormat FormsAuthPasswordFormat Enum

Definition

Defines the encryption format for storing passwords.

public enum class FormsAuthPasswordFormat
public enum FormsAuthPasswordFormat
type FormsAuthPasswordFormat = 
Public Enum FormsAuthPasswordFormat
Inheritance
FormsAuthPasswordFormatFormsAuthPasswordFormatFormsAuthPasswordFormatFormsAuthPasswordFormat

Fields

Clear Clear Clear Clear 0

Specifies that passwords are not encrypted. This field is constant.

MD5 MD5 MD5 MD5 2

Specifies that passwords are encrypted using the MD5 hash algorithm. This field is constant.

SHA1 SHA1 SHA1 SHA1 1

Specifies that passwords are encrypted using the SHA1 hash algorithm. This field is constant.

SHA256 SHA256 SHA256 SHA256 3

Specifies that passwords are encrypted using the SHA256 hash algorithm. This field is constant.

SHA384 SHA384 SHA384 SHA384 4

Specifies that passwords are encrypted using the SHA384 hash algorithm. This field is constant.

SHA512 SHA512 SHA512 SHA512 5

Specifies that passwords are encrypted using the SHA512 hash algorithm. This field is constant.

Examples

The following code example shows how to use the FormsAuthPasswordFormat enumeration. Refer to the code example in the FormsAuthenticationUserCollection class topic to learn how to get the collection.

// Get the current PasswordFormat property value.
FormsAuthPasswordFormat currentPasswordFormat =
formsAuthenticationCredentials.PasswordFormat;


// Set the PasswordFormat property value.
formsAuthenticationCredentials.PasswordFormat = 
    FormsAuthPasswordFormat.SHA1;

' Get the current PasswordFormat property value.
  Dim currentPasswordFormat _
  As FormsAuthPasswordFormat = _
  formsAuthenticationCredentials.PasswordFormat


' Set the PasswordFormat property value.
  formsAuthenticationCredentials.PasswordFormat = _
  FormsAuthPasswordFormat.SHA1

Remarks

To programmatically configure the type of encryption used to store passwords in a Web application, use the AuthenticationSection class. This class is also used internally by FormsAuthentication in the processing of authentication tickets.

Applies to