Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to use HMACSHA512 in forms?

$
0
0

Hi everybody,

How can i use HMACSHA512 in xamarin.forms

I can use this code in WF:

`public string CreateSignature(string secretKey, string messageRepresentation)
{
if (string.IsNullOrWhiteSpace(secretKey) || string.IsNullOrWhiteSpace(messageRepresentation))
return "";

    string signature;
    var secretBytes = Encoding.UTF8.GetBytes(secretKey);
    var valueBytes = Encoding.UTF8.GetBytes(messageRepresentation);

    using (var hmac = new HMACSHA256(secretBytes))
    {
        var hash = hmac.ComputeHash(valueBytes);
        signature = Convert.ToBase64String(hash);
    }
    return signature;
}`

Thanks.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>