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).Encrypts data and/or appends a hash-based message authentication code (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.The data to encrypt.

protectionOption
MachineKeyProtection

Indica si el parámetro data se debería cifrar o someterse a un algoritmo hash.Indicates whether the data parameter should be encrypted and/or hashed.

Devoluciones

String

El valor cifrado, el valor de entrada con HMAC anexado o el resultado de cifrar el valor de entrada con HMAC anexado.The encrypted value, the input value with an HMAC appended, or the result of encrypting the input value with an HMAC appended.

Atributos

Ejemplos

Para obtener un ejemplo de código, vea la MachineKey información general de la clase.For a code example, see the MachineKey class overview.

Comentarios

Para obtener información sobre qué algoritmos de cifrado y hash ASP.NET usa para descifrar y validar los datos que se pasan, consulte elemento machineKey (esquema de configuración de ASP.net).For information about which encryption and hashing algorithms ASP.NET uses to decrypt and validate the data that is passed in, see machineKey Element (ASP.NET Settings Schema).

Se aplica a