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 (código de autenticação de mensagem baseado em hash).

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 data parâmetro deve ser criptografado e/ou hash.

Retornos

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

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 machineKey Element (ASP.NET Settings Schema).

Aplica-se a