共用方式為


RsaSignatureCookieTransform.Encode(Byte[]) 方法

定義

簽署指定的資料。

public:
 override cli::array <System::Byte> ^ Encode(cli::array <System::Byte> ^ value);
public override byte[] Encode (byte[] value);
override this.Encode : byte[] -> byte[]
Public Overrides Function Encode (value As Byte()) As Byte()

參數

value
Byte[]

要簽署的資料。

傳回

Byte[]

已簽署的資料。

例外狀況

valuenull

value 包含零個位元組。

SigningKey 屬性為 null

-或-

SigningKey屬性所指定的金鑰無法如同RSACryptoServiceProvider一般加以指派。

-或-

SigningKey屬性所指定的金鑰不包含私密金鑰。

此作業系統不支援指定的演算法。

備註

屬性指定的 SigningKey 金鑰必須包含私鑰,才能簽署數據。

藉由呼叫 Decode 方法,即可驗證已簽署的數據。

適用於