語言

RsaEncryptionCookieTransform 類別

定義

使用 RSA.

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 服務時,若憑證提供的金鑰變更,服務必須重新啟動。

建構函式

名稱 Description
RsaEncryptionCookieTransform(RSA)

初始化一個使用指定金鑰進行加密與解密的類別新實例 RsaEncryptionCookieTransform 。

RsaEncryptionCookieTransform(X509Certificate2)

初始化一個新的類別實例 RsaEncryptionCookieTransform ,使用指定 X.509 憑證的私密金鑰進行加密與解密。

屬性

名稱 Description
DecryptionKeys

取得用於解密的金鑰預設情況下,此屬性會回傳僅包含加密金鑰的清單。

EncryptionKey

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

HashName

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

方法

名稱 Description
Decode(Byte[])

利用提供的 RSA 金鑰解密指定資料,解密 AES 金鑰,AES 金鑰再解密 Cookie。

Encode(Byte[])

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

Equals(Object)

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

(繼承來源 Object)
GetHashCode()

做為預設哈希函式。

(繼承來源 Object)
GetType()

取得目前實例的 Type。

(繼承來源 Object)
MemberwiseClone()

建立目前 Object的淺層複本。

(繼承來源 Object)
ToString()

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

(繼承來源 Object)

適用於

另請參閱