Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

HMACSHA512.ProduceLegacyHmacValues Property

Provides a workaround for the .NET Framework 2.0 implementation of the HMACSHA512 algorithm, which is inconsistent with the .NET Framework 2.0 Service Pack 1 implementation.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)
public bool ProduceLegacyHmacValues { get; set; }

Property Value

Type: System.Boolean
true to enable .NET Framework 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false.

The purpose of the ProduceLegacyHmacValues Boolean property is to enable .NET Framework 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications. When you set this property to true, the HMACSHA512 object produces values that match the values produced by the .NET Framework 2.0. You should set this property only once after you create your HMAC object. You will need to reset your key afterwards, as shown in the following example. 

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

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5 SP1, 3.0 SP1, 2.0 SP1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.