title: Debugging Signature Verification failure
body: <p>Using Java 1.4.2 with unlimited jurisdiction policy files installed.</p>
  
  <p>I have a class that has been successfully signing and verifying.  However, now I've changed the keys and suddenly verification is failing.</p>
  
  <p>Keys were generated with:</p>
  
  <pre><code>openssl genrsa -aes256 -out production_private.pem 2048
  openssl pkcs8 -topk8 -nocrypt -in production_private.pem -outform der -out production_private.der
  openssl rsa -in production_private.pem -pubout -outform DER -out production_public.der
  </code></pre>
  
  <p>I did do a verification using the PEM keys and openssl using:</p>
  
  <pre><code>openssl dgst -sha1 -sign production_private.pem -out test.txt.sha1 test.txt
  Enter pass phrase for production_private.pem:
  openssl dgst -sha1 -verify production_public.pem -signature test.txt.sha1 test.txt
  Verified OK
  </code></pre>
  
  <p>But it does not appear you can do that using DER keys.</p>
  
  <p>No errors are thrown.  Signature.verify just returns false.  Since it works with one set of keys and not another, my assumption is it must be a key problem of some kind.  </p>
  
  <p>Any additional thoughts on how I might verify that the keypair is correct?  I don't want to kill myself looking for coding errors just to find out that the keys were the source of the problem.</p>
  
  <p>I am happy to share source upon request - I just don't want to muddy the issue until necessary.</p>