title: what is different between public keys
body: <p>I have tried to create a public key in two ways,</p>
  
  <ol>
  <li><p>I created Self Signed Certificate and export it to .pfx file and used Openssl to get temp.cer file which contains the public key</p></li>
  <li><p>used openssl to generate a public key as follows.</p>
  
  <pre><code>openssl genrsa -out myjira.pem 1024
  
  openssl rsa -in temp.pem -pubout -out temp.pub
  </code></pre></li>
  </ol>
  
  <p>I am using an application and trying to implement OAuth on it. when I enter the public key from temp.cer (which is longer) it does not accepts it and says 
  <i>Must be a valid public key. java.security.InvalidKeyException:</i>. But when I enter the public key from temp.pub (which is  much shorter than the other one) it accepts it.
  now my question is what is differences between those public keys? </p>