The purpose of the ProduceLegacyHmacValues Boolean property is to enable .NET Framework version 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.
// ...
}
For additional information about the changes introduced by .NET Framework 2.0 SP1 to support HMACSHA512 output in the .NET Framework 2.0 environment, see the HMACSHA512 class.