語言

HMACSHA384.ProduceLegacyHmacValues 屬性

定義

警告

ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.

提供一個針對 .NET Framework 2.0 實作中 HMACSHA384 演算法的變通方法,該演算法與 .NET Framework 2.0 Service Pack 1 實作不一致。

public:
 property bool ProduceLegacyHmacValues { bool get(); void set(bool value); };
[System.Obsolete("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId="SYSLIB0029", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public bool ProduceLegacyHmacValues { get; set; }
public bool ProduceLegacyHmacValues { get; set; }
[<System.Obsolete("ProduceLegacyHmacValues is obsolete. Producing legacy HMAC values is not supported.", DiagnosticId="SYSLIB0029", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
member this.ProduceLegacyHmacValues : bool with get, set
member this.ProduceLegacyHmacValues : bool with get, set
Public Property ProduceLegacyHmacValues As Boolean

屬性值

true 讓 .NET Framework 2.0 Service Pack 1 應用程式能與 Framework 2.0 應用程式互動.NET;否則則false。

屬性

備註

ProduceLegacyHmacValues 布林屬性的目的是讓 Framework 2.0 服務包 1 應用程式能與 Framework 2.0 應用程式互動.NET.NET 當你將此屬性設為 true,HMACSHA384 物件會產生與 Framework 2.0 產生的數值相符.NET。 你應該在建立 HMAC 物件後只設定一次這個屬性。 之後你需要重置你的金鑰,如下範例所示。

public static void Test()
{
    var hmac = new HMACSHA384();
    hmac.ProduceLegacyHmacValues = true;
    hmac.Key = // ...Get the HMAC key.
    // ...
    // Use the HMAC algorithm.
    // ...
}

適用於

另請參閱