MachineKey.Encode(Byte[], MachineKeyProtection) Metoda

Definicja

Przestroga

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

String

Zaszyfrowana wartość, wartość wejściowa z dołączonym elementem HMAC lub wynik szyfrowania wartości wejściowej przy użyciu 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órych algorytmów szyfrowania i skrótów ASP.NET używa do odszyfrowywania i weryfikowania przekazanych danych, zobacz machineKey, element (ASP.NET Ustawienia Schema).

Dotyczy