MachineKey.Encode(Byte[], MachineKeyProtection) Metoda

Definicja

Uwaga

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.

Szyfruje dane i/lub dołącza kod uwierzytelniania komunikatów oparty na skrótach (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[]

Dane do zaszyfrowania.

protectionOption
MachineKeyProtection

Wskazuje, czy data parametr powinien być zaszyfrowany i/lub skrót.

Zwraca

Zaszyfrowana wartość, wartość wejściowa z dołączonym elementem HMAC lub wynik szyfrowania wartości wejściowej za pomocą dołączonego elementu HMAC.

Atrybuty

Przykłady

Aby zapoznać się z przykładem kodu, zobacz MachineKey omówienie klasy.

Uwagi

Aby uzyskać informacje o tym, które algorytmy szyfrowania i tworzenia skrótów są używane ASP.NET do odszyfrowywania i weryfikowania przekazanych danych, zobacz machineKey, element (ASP.NET Settings Schema).

Dotyczy