title: Load PKCS#8 binary key into Ruby
body: <p>I'm trying to load a particular private key encoded in binary <code>DER</code> format (<code>PKCS#8</code>) into Ruby. </p>
  
  <p>However, <code>OpenSSL::PKey</code> won't recognize it. I can make it work by doing some console work and transforming it into a <code>PEM</code> like so:</p>
  
  <pre><code>openssl pkcs8 -inform DER -in file.key -passin pass:xxxxxxxx &gt;private_key.pem
  </code></pre>
  
  <p>After this, the key can correctly be read.</p>
  
  <p>However, since I would like for the whole process to be done in memory instead of writing and reading files.</p>
  
  <p>So my question is: Is it possible to load private keys from the binary encoded <code>DER</code> format into Ruby/OpenSSL?</p>
  
  <p>Thank you for your time,</p>
  
  <p>Fernando</p>