public static void Main()
var time = DateTime.UtcNow.ToString("yyyyMMddHHmmss");
var tokenexId = "TokenExID";
var clientSecretKey = "ClientSecretKey";
Console.WriteLine("Use the output below as the authentication key in JSFiddle.");
Console.WriteLine("Authentication Key:" +GenerateHMAC(tokenexId+"|"+time+"|PCI", clientSecretKey));
Console.WriteLine("timestamp:"+time);
private static string GenerateHMAC(string payload,string HMACKey)
var hmac = new System.Security.Cryptography.HMACSHA256{Key = System.Text.Encoding.UTF8.GetBytes(HMACKey)};
var hash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(payload));
return Convert.ToBase64String(hash);