title: Generate OAuth signature in Java
body: <p>I'm working on java web application and now I'm trying to connect my website with <a href="https://webapps.ph.ed.ac.uk/qtiworks/" rel="nofollow">QTIWorks</a></p>
  
  <p>I have a consumer key and secret, I need to generate OAuth signature to connect with QTIWorks through LTI</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;head&gt; &lt;/head&gt;
  
  &lt;body&gt;
  &lt;form action="https://webapps.ph.ed.ac.uk/qtiworks-dev2/lti/domainlaunch" name="ltiLaunchForm" id="ltiLaunchForm" method="post" target="basicltiLaunchFrame" enctype="application/x-www-form-urlencoded" style="display: block;"&gt;
     &lt;input type="hidden" name="context_id" value="cid-00113"&gt;
     &lt;input type="hidden" name="context_label" value="SI106"&gt;
     &lt;input type="hidden" name="context_title" value="Design of Personal Environments 1"&gt;
     &lt;input type="hidden" name="ext_note" value="Instructor from first course"&gt;
     &lt;input type="hidden" name="launch_presentation_locale" value="en_us"&gt;
     &lt;input type="hidden" name="lis_person_contact_email_primary" value="sian@imscert.org"&gt;
     &lt;input type="hidden" name="lis_person_name_family" value="Instructor"&gt;
     &lt;input type="hidden" name="lis_person_name_given" value="Siân"&gt;
     &lt;input type="hidden" name="lis_person_sourcedid" value="school.edu:user"&gt;
     &lt;input type="hidden" name="resource_link_description" value="This learning space is private"&gt;
     &lt;input type="hidden" name="resource_link_id" value="res-0012612"&gt;
     &lt;input type="hidden" name="resource_link_title" value="My Weekly Wiki"&gt;
     &lt;input type="hidden" name="roles" value="Instructor"&gt;
     &lt;input type="hidden" name="tool_consumer_info_product_family_code" value="sakai-unit"&gt;
     &lt;input type="hidden" name="tool_consumer_info_version" value="0.9"&gt;
     &lt;input type="hidden" name="tool_consumer_instance_description" value="University of School (LMSng)"&gt;
     &lt;input type="hidden" name="tool_consumer_instance_guid" value="lmsng.school.edu"&gt;
     &lt;input type="hidden" name="user_id" value="user-0016"&gt;
     &lt;input type="hidden" name="oauth_callback" value="about:blank"&gt;
     &lt;input type="hidden" name="lis_outcome_service_url" value="...."&gt;
     &lt;input type="hidden" name="lis_result_sourcedid" value="{&amp;quot;zap&amp;quot; : &amp;quot;Siân JSON 1234 Sourcedid &lt;&gt;&amp;amp;lt;&amp;quot;}"&gt;
     &lt;input type="hidden" name="custom_simple_key" value="custom_simple_value"&gt;
     &lt;input type="hidden" name="custom_complex____________key" value="Complex!@#$^*(){}[]½Value"&gt;
     &lt;input type="hidden" name="lti_version" value="LTI-1p0"&gt;
     &lt;input type="hidden" name="lti_message_type" value="basic-lti-launch-request"&gt;
     &lt;input type="submit" name="ext_submit" value="Finish Launch"&gt;
     &lt;input type="hidden" name="oauth_version" value="1.0"&gt;
     &lt;input type="hidden" name="oauth_nonce" value="505005bff1c2cf2e1750ed914e489a9b"&gt;
     &lt;input type="hidden" name="oauth_timestamp" value="1427022367"&gt;
     &lt;input type="hidden" name="oauth_consumer_key" value="my consumer key"&gt;
     &lt;input type="hidden" name="oauth_signature_method" value="HMAC-SHA1"&gt;
     &lt;input type="hidden" name="oauth_signature" value="I need generate this value"&gt;
     &lt;input type="hidden" name="ext_submit" value="Finish Launch"&gt;
     &lt;input type="submit" name="submit" value="submit"&gt;&lt;/form&gt;
  
  
  &lt;iframe name="basicltiLaunchFrame" id="basicltiLaunchFrame" src="" width="100%" height="900" scrolling="auto" frameborder="1" transparency=""&gt;
  
  &lt;/iframe&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>I need to generate OAuth signature at this line</p>
  
  <pre><code>&lt;input type="hidden" name="oauth_signature" value="I need generate this value"&gt;
  </code></pre>
  
  <p>How can I do that?</p>