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

Definição

Atenção

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.

Encripta dados e/ou adiciona um código de autenticação de mensagens baseado em 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[]

Os dados a encriptar.

protectionOption
MachineKeyProtection

Indica se o data parâmetro deve ser encriptado e/ou com hash.

Devoluções

O valor encriptado, o valor de entrada com um HMAC adicionado, ou o resultado da encriptação do valor de entrada com um HMAC adicionado.

Atributos

Exemplos

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

Observações

Para informações sobre quais algoritmos de encriptação e hash ASP.NET utiliza para desencriptar e validar os dados que são passados, veja machineKey Element (ASP.NET Settings Schema).

Aplica-se a