title: OpenSSL ECDSA sign and verify file
body: <p>I would like to sign and verify a pdf with elliptic curve. I got some code but it doesn't work.</p>
  
  <p>Create private key:</p>
  
  <pre><code>openssl ecparam -genkey -name secp384r1 -noout -out private.pem
  </code></pre>
  
  <p>Create public key:</p>
  
  <pre><code>openssl ec -in private.pem -pubout -out public.pem
  </code></pre>
  
  <p>Sign file:</p>
  
  <pre><code>openssl dgst -ecdsa-with-SHA1 test.pdf &gt; hash openssl dgst
  openssl dgst -ecdsa-with-SHA1 -inkey private.pem -keyform PEM -in hash &gt; signature
  </code></pre>
  
  <p>Verify file:</p>
  
  <pre><code>openssl dgst -ecdsa-with-SHA1 -verify public.pem -signature signature.bin data
  </code></pre>
  
  <p>The part to sign and verify doesn't work.</p>