Επεξεργασία

Κοινή χρήση μέσω


MachineKey.Decode(String, MachineKeyProtection) Method

Definition

Caution

This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.

Decodes and/or validates data that has been encrypted or provided with a hash-based message authentication code (HMAC).

public:
 static cli::array <System::Byte> ^ Decode(System::String ^ encodedData, System::Web::Security::MachineKeyProtection protectionOption);
public static byte[] Decode (string encodedData, System.Web.Security.MachineKeyProtection protectionOption);
[System.Obsolete("This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.")]
public static byte[] Decode (string encodedData, System.Web.Security.MachineKeyProtection protectionOption);
static member Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
[<System.Obsolete("This method is obsolete and is only provided for compatibility with existing code. It is recommended that new code use the Protect and Unprotect methods instead.")>]
static member Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
Public Shared Function Decode (encodedData As String, protectionOption As MachineKeyProtection) As Byte()

Parameters

encodedData
String

The encrypted data to decrypt and/or validate.

protectionOption
MachineKeyProtection

Indicates whether the encodedData parameter should be encrypted and/or hashed.

Returns

Byte[]

A Byte array that represents the decrypted data.

Attributes

Examples

For a code example, see the MachineKey class overview.

Remarks

For information about which encryption and hashing algorithms ASP.NET uses to decrypt and validate the data that is passed in, see machineKey Element (ASP.NET Settings Schema).

Applies to