MachineKey.Encode(Byte[], MachineKeyProtection) Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Figyelemfelhívás
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.
Titkosítja az adatokat, és/vagy hozzáfűz egy kivonatalapú üzenethitelesítési kódot (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
Paraméterek
- data
- Byte[]
A titkosítandó adatok.
- protectionOption
- MachineKeyProtection
Azt jelzi, hogy a data paramétert titkosítva és/vagy kivonatolva kell-e megadni.
Válaszok
A titkosított érték, a bemeneti érték egy HMAC hozzáfűzésével, vagy a bemeneti érték HMAC hozzáfűzéssel történő titkosításának eredménye.
- Attribútumok
Példák
Egy példakódért tekintse meg az osztály áttekintését MachineKey .
Megjegyzések
További információ arról, hogy mely titkosítási és kivonatolási algoritmusok ASP.NET az átadott adatok visszafejtéséhez és ellenőrzéséhez: machineKey elem (ASP.NET Beállítások séma).