title: Is it possible to sign a PDF document with hash and signed hash?
body: <p>I can sign document using itextpdf library with external signature.</p>
  
  <p>But the problem is that the end user doesn't want to send his document because it may contain any sensitive data. So, I asked the end user to give document hash for signing the hash with external service and send the signed hash back.   </p>
  
  <p>But, here comes the problem, when they tried to sign the document with the given signed hash using itextpdf (<code>PdfSignatureAppearance</code>) the PDF document is getting signed. But when verifying the signature it showing that  the signature is invalid. </p>
  
  <p>I've seen the same kinda question here
    <a href="https://stackoverflow.com/q/28717704/7878678">Sign PDF using an external service and iText</a> .</p>
  
  <p>So, the problem happens because the hash gets invalidated each time when we open the document using <code>PdfSignatureAppearance</code> (itextpdf library).</p>
  
  <p>Can anyone please tell me whether it is possible to sign the PDF document with previously generated hash and signed hash (which I got from external service) using itextpdf library so that the hash should not get invalidated?</p>