Code samples
WebSub HMAC verification
C#
using System;
using System.Linq;
using System.Text;
using System.Security.Cryptography;
public class Program
{
public static void Main()
{
Encoding utf8 = Encoding.UTF8;
String client_secret = "supersecret";
HMACSHA256 hmac_new_content = new HMACSHA256(utf8.GetBytes(client_secret));
String http_body = "{.....}";
Byte[] new_content_sig = hmac_new_content.ComputeHash(utf8.GetBytes(http_body));
Console.WriteLine(BitConverter.ToString(new_content_sig).Replace("-", ""));
}
}Go
Last updated
Was this helpful?