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

Définition

Attention

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.

Chiffre les données et/ou ajoute du code 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

Paramètres

data
Byte[]

Données à chiffrer.

protectionOption
MachineKeyProtection

Indique si le paramètre data doit être chiffré et/ou haché.

Retours

La valeur chiffrée, la valeur d'entrée avec un HMAC a ajouté, ou le résultat du chiffrement de la valeur d'entrée avec un HMAC ajouté.

Attributs

Exemples

Pour obtenir un exemple de code, consultez la vue d’ensemble de la MachineKey classe.

Remarques

Pour plus d’informations sur les algorithmes de chiffrement et de hachage que ASP.NET utilise pour déchiffrer et valider les données transmises, consultez élément machineKey (schéma des paramètres ASP.NET) .

S’applique à