MachineKey.Encode(Byte[], MachineKeyProtection) Método

Definición

Precaució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.

Cifra los datos y/o anexa un código de autenticación de mensaje basado en 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

Parámetros

data
Byte[]

Datos que se van a cifrar.

protectionOption
MachineKeyProtection

Indica si el parámetro data se debería cifrar o someterse a un algoritmo hash.

Devoluciones

El valor cifrado, el valor de entrada con HMAC anexado o el resultado de cifrar el valor de entrada con HMAC anexado.

Atributos

Ejemplos

Para obtener un ejemplo de código, consulte la información general de la MachineKey clase.

Comentarios

Para obtener información sobre qué algoritmos de cifrado y hash ASP.NET usa para descifrar y validar los datos que se pasan, vea machineKey Element (ASP.NET Settings Schema)).

Se aplica a