MachineKey.Decode(String, MachineKeyProtection) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
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.
解码和/或验证已加密或随基于哈希的消息身份验证代码(HMAC)提供的数据。
public:
static cli::array <System::Byte> ^ Decode(System::String ^ encodedData, System::Web::Security::MachineKeyProtection protectionOption);
public static byte[] Decode(string encodedData, 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 byte[] Decode(string encodedData, System.Web.Security.MachineKeyProtection protectionOption);
static member Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
[<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 Decode : string * System.Web.Security.MachineKeyProtection -> byte[]
Public Shared Function Decode (encodedData As String, protectionOption As MachineKeyProtection) As Byte()
参数
- encodedData
- String
要解密和/或验证的加密数据。
- protectionOption
- MachineKeyProtection
指示参数是否 encodedData 应进行加密和/或哈希处理。
返回
Byte[]
一个 Byte 表示解密数据的数组。
- 属性
示例
有关代码示例,请参阅 MachineKey 类概述。
注解
有关 ASP.NET 用于解密和验证传入的数据的加密和哈希算法的信息,请参阅 machineKey 元素(ASP.NET 设置架构)。