title: Verifying a SHA1 Digest from a text string
body: <p>I'm having a problem verifying a SHA1 digest in base64 of a text string.</p>
  
  <p>I have this text string in a file (test1):</p>
  
  <pre><code>2008-03-10;2008-03-10T15:58:00;FT 1/1;28.07;
  </code></pre>
  
  <p>And I used the follow command to encoded it (remember that I am encoding the text string not the text file per se):</p>
  
  <pre><code>openssl dgst -sha1 -sign Private_key.pem &lt; test1 | openssl enc -base64 &gt; hash1
  </code></pre>
  
  <p>Which results in the follow digest:</p>
  
  <pre><code>F8952fjEClltx2tF9m6/QTFynFjSuiboMslNZ1ag9oR5iIivgYYa0cNa0wJeWXlsf8QQVHUol303hp7XmIy5/kFOiV0v8QH6SF0Q5zNsDtpeFh2ZJ256y0DkJMSQqCq3oSka+9zIXXRkXgEsSv6VScCYv8VTlIcGjsablpR6A4=
  </code></pre>
  
  <p>Now I want to verify this digest using the Public Key, however the command that I used was an example giving in the openssl how-to:</p>
  
  <pre><code>openssl dgst -sha1 -verify Public_key.pem -signature hash1 test1
  </code></pre>
  
  <p>But this always give me "Verification Failure".</p>
  
  <p>Note: The hash1 file does not have any \n  and the test1 file contains the string which was encoded.</p>