111,095
社区成员




//通过appSecret计算出来的签名值
private static string HmacSHA256(string appSecret, string timeStamp)
{
timeStamp = timeStamp ?? "";
var encoding = new System.Text.UTF8Encoding();
byte[] keyByte = encoding.GetBytes(appSecret);
byte[] messageBytes = encoding.GetBytes(timeStamp);
using (var hmacsha256 = new HMACSHA256(keyByte))
{
byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
return Convert.ToBase64String(hashmessage);
}
}
System.Security.Cryptography.HMACSHA256