title: Ruby SHA1 sign returns different result than OpenSSL sign
body: <p>When I do openssl command at linux command line:</p>
  
  <pre><code>echo -n "aaaaaa" | /usr/bin/openssl dgst -sha1 -sign myprivatekey.pem | /usr/bin/openssl enc -base64 -A
  </code></pre>
  
  <p>I get this result:</p>
  
  <pre><code>2GmJqeVDbGFsaJjMKcjW4JhPYBdI7mSwNYKrmdHtM2xpWVVSdhXc0d3zidF790mz9n9nb2yX+jMZpzNNd8xAx/WeSRxnYCg0Y/TXoMG4ynbCnttpzxrN08TJNggLOz0fWbzfMQZbHy+WghU8SlOhQExngtH8yvtE71060C/KKtI=
  </code></pre>
  
  <p>And by running this ruby script:</p>
  
  <pre><code>require 'openssl'
  require 'base64'
  
  pkey = OpenSSL::PKey::RSA.new(File.read("myprivatekey.pem"))
  plaintext = OpenSSL::Digest::SHA1.new("aaaaaa").digest
  enc = pkey.private_encrypt(plaintext)
  puts Base64.encode64(enc)
  </code></pre>
  
  <p>The result is different:</p>
  
  <pre><code>rHdXk0itL88vrz84QvCpRHM7J1w/B+Jaoo7n3fQ1D0UiPYQ4jClLQcO3iQLVifq/jMXBYvPLzQVZa/J9D7gjOwKYkKlu5c18HV8U4h0jXM7yTNCYlekhVsBThUcfb2kb1Lf2Ow3cjwL7ss66bvUc9+bwDGHtp3uJ9/GbJlZdphE=
  </code></pre>
  
  <p>Can anyone help me ? Why am I doing wrong in the ruby part? I want to replicate the linux command line command!</p>