语言

RsaEncryptionCookieTransform 类

定义

使用 RSA. 加密 Cookie。

public ref class RsaEncryptionCookieTransform : System::IdentityModel::CookieTransform
public class RsaEncryptionCookieTransform : System.IdentityModel.CookieTransform
type RsaEncryptionCookieTransform = class
    inherit CookieTransform
Public Class RsaEncryptionCookieTransform
Inherits CookieTransform
继承
RsaEncryptionCookieTransform

注解

使用此转换加密的 Cookie 可由共享同一 RSA 私钥的任何计算机(通常与 X.509 证书关联)解密。

给定数据使用随机 AES256 密钥进行加密。 然后,此密钥使用 RSA 进行加密,RSA 公钥以纯文本形式发送,以便在解码类时知道要使用的 RSA 密钥。

Important

与 RsaEncryptionCookieTransform 服务一起使用时,如果证书提供的密钥更改了服务,则必须重启该服务。

构造函数

名称 说明
RsaEncryptionCookieTransform(RSA)

初始化使用指定密钥进行加密和解密的 RsaEncryptionCookieTransform 类的新实例。

RsaEncryptionCookieTransform(X509Certificate2)

初始化类的新实例,该类 RsaEncryptionCookieTransform 使用指定 X.509 证书的私钥进行加密和解密。

属性

名称 说明
DecryptionKeys

获取用于解密的密钥,默认情况下,此属性返回仅包含加密密钥的列表。

EncryptionKey

获取或设置用于加密的 RSA 密钥。

HashName

获取或设置要使用的哈希算法的名称。

方法

名称 说明
Decode(Byte[])

使用提供的 RSA 密钥解密指定的数据,以解密 AES 密钥,该密钥解密 Cookie。

Encode(Byte[])

对指定的数据进行编码。 数据使用默认加密算法(AES-256)进行加密,然后使用 RSA 对 AES 密钥进行加密,并追加 RSA 公钥。

Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type。

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅