API Signature help

AntMiner • Beginners • DArKer • Posted 2017-09-27 02:52:16 • Read 656 times

I'm writing api code using Powershell.

$hmacsha = New-Object System.Security.Cryptography.HMACSHA256
$hmacsha.key = [Text.Encoding]::ASCII.GetBytes($secret)
$signature = $hmacsha.ComputeHash([Text.Encoding]::ASCII.GetBytes($username+$api_key+$nonce))
$signature = [Convert]::ToBase64String($signature)
$postParams = @{key=$api_key;nonce=$nonce;signature=$signature.ToUpper();coin=$coin}
Invoke-WebRequest -Uri $PoolUri -Method POST -Body $postParams

 And always got;

{"code":-7,"message":"Signature error"}

 

What wrong with my signature?


You need to Sign In before replying, if there is not an account you can Sign Up for an account.
 Create a new topic
Hash Rate & Mining Difficulty
 PH/s
BTC PRICE INDEX (24H)
Latest Blocks
Height:  
Size:  
Nonce:  
Bits:  
Relayed By:  
USD  % 
EUR  €