SessionSecurityTokenHandler.ApplyTransforms(Byte[], Boolean) 方法

定义

Transforms 属性指定的转换应用于对指定 Cookie 进行编码或解码。Applies the transforms specified by the Transforms property to either encode or decode the specified cookie.

protected:
 virtual cli::array <System::Byte> ^ ApplyTransforms(cli::array <System::Byte> ^ cookie, bool outbound);
protected virtual byte[] ApplyTransforms (byte[] cookie, bool outbound);
abstract member ApplyTransforms : byte[] * bool -> byte[]
override this.ApplyTransforms : byte[] * bool -> byte[]
Protected Overridable Function ApplyTransforms (cookie As Byte(), outbound As Boolean) As Byte()

参数

cookie
Byte[]

将转换的 cookie。The cookie that will be transformed.

outbound
Boolean

如果应编码 cookie,则为 true;如果应解码 cookie,则为 falsetrue if the cookie should be encoded; false if the cookie should be decoded.

返回

Byte[]

编码或解码的 cookie。The encoded or decoded cookie.

例外

Transforms 属性为 nullThe Transforms property is null.

注解

当对 cookie 转换进行编码时,将按照它们在属性中出现的顺序应用 TransformsWhen encoding a cookie transforms are applied in the order in which they appear in the Transforms property. 当对 cookie 进行解码时,它们将按相反的顺序应用。When decoding a cookie, they are applied in the reverse order.

WriteToken 和方法调用 ReadToken 以对 cookie 材料进行编码和解码。Called from the WriteToken and ReadToken methods to encode and decode the cookie material.

适用于