title: Verify signed PDF Document in PHP
body: <p>I have a signed PDF document. It was signed by using TCPDF. Now I want to verify it. This is my solution:</p>
  
  <ul>
  <li>Get content of signed pdf. </li>
  <li>Get original content and signature value base on /ByRange field.</li>
  <li>Get encrypted digest message from signature value. It's octet string at the end of signature value.</li>
  <li>Use Openssl_public_decrypt() function to decrypt the encrypted digest message with public key. Then we have a string which has a prefix ("3021300906052b0e03021a05000414"). This prefix denotes the hash function used is SHA-1. After removing the prefix, we obtain digest message D1.</li>
  <li>Use SHA1() function to hash original content, we obtain digest message D2.</li>
  <li>Compare D1 with D2. If D1 = D2 then signature is valid and vice versa.</li>
  </ul>
  
  <p>My problem is in last step, when I compare D1 with D2, they are not equal. I don't know why. 
  Thanks for any help.</p>