0
votes

Goodmorning, i am forced to use AS3 (AIR desktop), and i have to calculate HMAC SHA256 of a string, using a string key, and obtaining a string result.

This is what i would do if i could do it without AS3:

[linux]$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000&timestamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
(stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

How can i obtain the same result, with AS3?

1
I'd start with googling actionscript-3 sha256 library, then taking one of those found and fiddling with it whether it can do the hashing you desire.Vesper

1 Answers

0
votes

I have found the answer: AS3 HMAC SHA-256 for Adobe AIR (desktop)

com.adobe.crypto is what you are searching for.