title: Auth 1.0 oauth_signature creation Android for magento API
body: <p>I call the Magento API with the following Autherization as header,</p>
  
  <pre><code>auth = "OAuth oauth_consumer_key=**********************,oauth_consumer_secret=****************,oauth_token=************,oauth_token_secret=**************,oauth_signature_method=HMAC-SHA1,oauth_timestamp=" + ConstantFunctions.GetTimeStamp() + ",oauth_nonce=" + ConstantFunctions.GetNonce() + ",oauth_signature=*******************) ;
  </code></pre>
  
  <p>While I call the API,
  Getting error <code>oauth_problem=signature_invalid</code> .All other parameters validate successfully but got an error in the signature,
  I try the following code to generate the signature,</p>
  
  <pre><code>     public static String GETHMACSHA1(String value, String key)
              throws UnsupportedEncodingException, NoSuchAlgorithmException,
              InvalidKeyException {
          String type = "HmacSHA1";
          SecretKeySpec secret = new SecretKeySpec(key.getBytes(), type);
          Mac mac = Mac.getInstance(type);
          mac.init(secret);
          byte[] bytes = mac.doFinal(value.getBytes());
          return bytesToHex(bytes);
      }
  
      private final static char[] hexArray = "0123456789abcdef".toCharArray();
  
      private static String bytesToHex(byte[] bytes) {
          char[] hexChars = new char[bytes.length * 2];
          int v;
          for (int j = 0; j &lt; bytes.length; j++) {
              v = bytes[j] &amp; 0xFF;
              hexChars[j * 2] = hexArray[v &gt;&gt;&gt; 4];
              hexChars[j * 2 + 1] = hexArray[v &amp; 0x0F];
          }
          return new String(hexChars);
      }
  </code></pre>
  
  <p>I pass the <code>oauth_consumer_secret</code> and <code>oauth_token_secret</code> as the parameter to get signature . But its still get the same error. </p>
  
  <p>How to generate the signature in android and which value I need to pass to get the same?</p>