I have the following C# code in a .NET application I'd like to do the same thing in a Power Automate Flow.
Is that possible?
private string GetSignature(string signtext, string privateKey)
{
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
byte[] keybytes = encoding.GetBytes(privateKey);
byte[] signbytes = encoding.GetBytes(signtext);
HMACSHA256 hmacsha256 = new HMACSHA256(keybytes);
return EncodeTo64(ByteToString(hmacsha256.ComputeHash(signbytes)).ToLower());
}
private string EncodeTo64(string toEncode)
{
byte[] toEncodeAsBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(toEncode);
string returnValue = System.Convert.ToBase64String(toEncodeAsBytes);
return returnValue;
}
The HMACSHA256 class is in the .NET System.Security.Cryptography namespace.
Solved! Go to Solution.
Hi @cymorg1
There is a third party connector available for HMAC encryption. Please have a look at this.
@Jay-Encodian could help you here.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @cymorg1
There is a third party connector available for HMAC encryption. Please have a look at this.
@Jay-Encodian could help you here.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks @abm - Encodian to the rescue again.
https://support.encodian.com/hc/en-gb/articles/360012782058-Create-HMAC
@abm Thank you for all your contributions to the forum. I appreciate it very much.
User | Count |
---|---|
89 | |
40 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
54 | |
47 | |
36 | |
25 |