title: Convert hmac function from python to Java
body: <p>I want to convert the below python code to the same java code.
  I am not sure how to get the same result by using java.
  I tried to use hmacutils in apache codec package but the result is not the same.
  python code:</p>
  <pre><code>import hmac
  import hashlib
  secret_key = b&quot;NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j&quot;
  total_params = b&quot;/public/api/ver1/accounts/new?type=binance&amp;name=binance_account&amp;api_key=XXXXXX&amp;secret=YYYYYY&quot;
  signature = hmac.new(secret_key, total_params, hashlib.sha384).hexdigest()
  print(&quot;signature = {0}&quot;.format(signature))
  </code></pre>