Share via


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 金鑰。

重要

搭配服務使用 RsaEncryptionCookieTransform 時,如果憑證提供的密鑰變更服務,則必須重新啟動服務。

建構函式

RsaEncryptionCookieTransform(RSA)

初始化 RsaEncryptionCookieTransform 類別的新執行個體,這個執行個體使用指定的加密及解密金鑰。

RsaEncryptionCookieTransform(X509Certificate2)

初始化 RsaEncryptionCookieTransform 類別的新執行個體,這個執行個體使用指定的 X.509 憑證的私密金鑰來加密和解密。

屬性

DecryptionKeys

取得用來解密的金鑰。根據預設,這個屬性會傳回只包含加密金鑰的清單。

EncryptionKey

取得或設定用於加密的 RSA 金鑰。

HashName

取得或設定要使用的雜湊演算法名稱。

方法

Decode(Byte[])

使用提供的 RSA 金鑰解密會將 Cookie 的解密 AES 金鑰,以將指定的資料解密。

Encode(Byte[])

將指定的資料編碼。 資料是使用預設加密演算法 (AES-256) 來加密的,然後使用 RSA 加密 AES 金鑰並附加 RSA 公開金鑰。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱