So in the old days I used to use System.Security.Cryptography which is not available in windows 8. what i found in windows 8 was windows.security
but i didn’t find any examples on how to use Sha256 with a key.
This is the old code that I used with System.Security.Cryptography
string appID = "appid";
string key = "password";
var hmacsha256 = new HMACSHA256(Encoding.Default.GetBytes(key));
hmacsha256.ComputeHash(Encoding.Default.GetBytes(appID));
string k = "";
foreach (byte test in hmacsha256.Hash)
{
k += test.ToString("X2");
}
Per the .NET Framework documentation, the class you used is available in .NET 4.5 and supported on Windows 8.
http://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha256.aspx
If you’re talking about the WinRT runtime, this might be what you want: http://channel9.msdn.com/Forums/TechOff/Porting-to-WinRT/4df7586e1ef5400682eda00f0143b610