title: How to get public key in hex format from a X.509 certificate
body: <p>Is it possible to get only the public key in hex format through openssl? I've used the command:</p>
  
  <pre><code>openssl x509 -in a.pem -text -noout
  </code></pre>
  
  <p>That just prints the certificate, where public key is available in hex format, but I cannot parse that. This command for instance:</p>
  
  <pre><code>openssl x509 -in a.pem -pubkey -noout
  </code></pre>
  
  <p>returns the public key in the following format:</p>
  
  <pre><code>-----BEGIN PUBLIC KEY-----
  #######
  ####===
  -----END PUBLIC KEY----
  </code></pre>
  
  <p>Is there a better way to do this? I'm expecting output in a hexadecimal format.</p>