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

Definição

Cuidado

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.

Criptografa dados e/ou acrescenta um HMAC (hash-based message authentication code).

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[]

Os dados a serem criptografados.

protectionOption
MachineKeyProtection

Indica se o parâmetro data deve ser criptografado e/ou transformado em hash.

Retornos

String

O valor criptografado, o valor de entrada acrescido de um HMAC ou o resultado da criptografia do valor de entrada acrescido de um HMAC.

Atributos

Exemplos

Para obter um exemplo de código, consulte a visão geral da MachineKey classe.

Comentários

Para obter informações sobre quais algoritmos de criptografia e hash ASP.NET usa para descriptografar e validar os dados passados, consulte o elemento machineKey (ASP.NET Configurações Esquema).

Aplica-se a