title: How Should I compute signatures in API?
body: <p>I want to create API for yobit. For now, I will do something very simple, namely get info.</p>
  
  <p>In Python, the code sort of looks like this</p>
  
  <pre><code> url = 'https://yobit.net/tapi'
      values['method'] = method
      values['nonce'] = str(int(time.time()))
      body = urlencode(values)
      signature = hmac.new(self.secret, body, hashlib.sha512).hexdigest()
      headers = {
          'Content-Type': 'application/x-www-form-urlencoded',
          'Key': self.key,
          'Sign': signature
      }
  </code></pre>
  
  <p>I basically want to replace code  <code>hmac.new(self.secret, body, hashlib.sha512).hexdigest()</code> with vb.net equivalent.</p>
  
  <p>This my current code</p>
  
  <pre><code>Public Overrides Sub readbalances()
      Dim secret = _secret
      Dim url = "https://yobit.net/tapi"
      Dim key = New Tuple(Of String, String)("Key", _apiKey)
      Dim parameters = "method=getInfo&amp;nonce=" + Str(Int(DateTime.Now))
      Dim sig = New System.Security.Cryptography.HMACSHA512().ToString 'What should I put here?
      Dim sigtupple = New Tuple(Of String, String)("Sign", sig)
      Dim result = CookieAwareWebClient.downloadString1("url", {key, sigtupple}, parameters)
  End Sub
  </code></pre>
  
  <p>What should I do?</p>
  
  <p>Content of downloadString1 is the following but let's just say it performs as expected</p>
  
  <pre><code>Public Shared Function downloadString1(url As String, headers As Tuple(Of String, String)(), postdata As String) As String
      Dim wc = New CookieAwareWebClient
  
      For Each header In headers
          wc.Headers.Add(header.Item1, header.Item2)
      Next
      Dim result = wc.UploadString(url, postdata)
      Return result
  End Function
  </code></pre>