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 dati e/o aggiunge un codice HMAC (Hash-based Message Authentication).

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 parametro data deve essere crittografato e/o sottoposto a hashing.

Restituisce

Il valore crittografato, il valore di input con un HMAC accodato o il risultato della crittografia del valore di input con un HMAC accodato.

Attributi

Esempio

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

Commenti

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

Si applica a