MembershipProvider.EncryptPassword Method (Byte[], MembershipPasswordCompatibilityMode)

.NET Framework (current version)
 

Encrypts the specified password using the specified password-compatibility mode.

Namespace:   System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)

abstract EncryptPassword : 
        password:byte[] *
        legacyPasswordCompatibilityMode:MembershipPasswordCompatibilityMode -> byte[]
override EncryptPassword : 
        password:byte[] *
        legacyPasswordCompatibilityMode:MembershipPasswordCompatibilityMode -> byte[]

Parameters

password
Type: System.Byte[]

A byte array that contains the password to encrypt.

legacyPasswordCompatibilityMode
Type: System.Web.Configuration.MembershipPasswordCompatibilityMode

The membership password-compatibility mode.

Return Value

Type: System.Byte[]

A byte array that contains the encrypted password.

Exception Condition
ProviderException

The ValidationKey property or DecryptionKey property is set to AutoGenerate.

PlatformNotSupportedException

This method is not available. This can occur if the application targets the .NET Framework 4 Client Profile. To prevent this exception, override the method, or change the application to target the full version of the .NET Framework.

.NET Framework
Available since 4.0
Return to top
Show: