title: Replace signature content in a PDF
body: <p>How can this be done in iText? I have a PDF with a signature from a client. I need to add an ocsp response to unsigned attributes.</p>
  
  <p>I know how to change the signature itself using</p>
  
  <pre><code>org.bouncycastle.cms.CMSSignedData.replaceSigners(...).getEncoded()
  </code></pre>
  
  <p>but I don't know how to replace <code>PdfName.CONTENTS</code> in the PDF using <code>new PdfString(newSignature).setHexWriting(true)</code>. If I use this code:</p>
  
  <pre><code>PdfDictionary other = new PdfDictionary();
  other.put(PdfName.CONTENTS, new PdfString(newSignature).setHexWriting(true));
  dicSignature.merge(other);
  </code></pre>
  
  <p>where <code>dicSignature</code> is the dictionary which contains the signature, then the signature (when the document is opened in Adobe Reader) is broken.</p>