MachineKey.Encode(Byte[], MachineKeyProtection) Metodo

Definizione

Attenzione

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.

Crittografa i dati e/o accoda un codice HMAC (Hash-Based Message Authentication Code).

public:
 static System::String ^ Encode(cli::array <System::Byte> ^ data, System::Web::Security::MachineKeyProtection protectionOption);
public static string Encode(byte[] data, 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 string Encode(byte[] data, System.Web.Security.MachineKeyProtection protectionOption);
static member Encode : byte[] * System.Web.Security.MachineKeyProtection -> string
[<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 Encode : byte[] * System.Web.Security.MachineKeyProtection -> string
Public Shared Function Encode (data As Byte(), protectionOption As MachineKeyProtection) As String

Parametri

data
Byte[]

Dati da crittografare.

protectionOption
MachineKeyProtection

Indica se il data parametro deve essere crittografato e/o sottoposto a hashing.

Valori restituiti

Valore crittografato, valore di input con un HMAC aggiunto o risultato della crittografia del valore di input con un HMAC aggiunto.

Attributi

Esempio

Per un esempio di codice, vedere la panoramica della MachineKey classe.

Commenti

Per informazioni sugli algoritmi di crittografia e hash ASP.NET usati per decrittografare e convalidare i dati passati, vedere machineKey Element (ASP.NET Settings Schema).

Si applica a