I found/ - Installing from Nuguet Pclcrypto(when installing, Assembly Validation has to be appearing tbm in the reference list, or install manually by entering the Pclcrypto folder). just send that code there and success!
public string CreateHash(string date, string userId) {
IMacAlgorithmProvider mac = WinRTCrypto.MacAlgorithmProvider.OpenAlgorithm(MacAlgorithm.HmacSha512);
byte[] keyMaterial = WinRTCrypto.CryptographicBuffer.ConvertStringToBinary(date, crypto.Encode());
ICryptographicKey cryptoKey = mac.CreateKey(keyMaterial);
byte[] hash = WinRTCrypto.CryptographicEngine.Sign(cryptoKey, WinRTCrypto.CryptographicBuffer.ConvertStringToBinary(userId, Encoding.UTF8));
StringBuilder hashHMAC = new StringBuilder();
for (int i = 0; i < hash.Length; i++) {
hashHMAC.Append(hash[i].ToString("X2"));
}
return hashHMAC.ToString();
}
So, I’ve tried this but in PCL (Portable Class Labrary) does not have the assemblys related to this encryption, and if I try to download by Nuguet, also does not accept. The only package I was able to install by Nuguet was Pclcrypto, but I was unable to create an encryption in the model I reported by entering a secret key, the examples I found will only inform the content to be encrypted.
– Darlan Soares
I edited the post. Take a look and see if it works now.
– Leonardo Pessoa
It was not expensive, I copied and pasted, I tried to import Assembly Mono.Android, unsuccessfully. does not recognize this code. Thanks for the effort, I keep trying here...
– Darlan Soares