MachineKey.Encode(Byte[], MachineKeyProtection) Metoda

Definice

Upozornění

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.

Zašifruje data nebo připojí ověřovací kód zpráv založený na hodnotě hash (HMAC).

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

Parametry

data
Byte[]

Data, která se mají šifrovat.

protectionOption
MachineKeyProtection

Určuje, jestli data má být parametr zašifrovaný nebo hashovaný.

Návraty

Zašifrovaná hodnota, vstupní hodnota s připojeným objektem HMAC nebo výsledek šifrování vstupní hodnoty s připojeným objektem HMAC.

Atributy

Příklady

Příklad kódu najdete v přehledu MachineKey třídy.

Poznámky

Informace o tom, které šifrovací a hashovací algoritmy ASP.NET používají k dešifrování a ověření předaných dat, najdete v tématu machineKey – element (ASP.NET schéma nastavení).

Platí pro