title: iText certificate verification
body: <p>I'm following the iText certificate verification example (it's the 3rd example found here: <a href="https://itextpdf.com/en/resources/examples/itext-7/digital-signatures-chapter-5" rel="nofollow noreferrer">https://itextpdf.com/en/resources/examples/itext-7/digital-signatures-chapter-5</a>).</p>
  
  <p>I don't quite get the following piece of code (I'm using iTextsharp with C#, but code for java is similar):</p>
  
  <pre><code>PdfPKCS7 pkcs7 = base.VerifySignature(fields, name);
  X509Certificate[] certs = pkcs7.SignCertificateChain;
  DateTime cal = pkcs7.SignDate;
  Object[] errors = CertificateVerification.VerifyCertificates(certs, certificates, null, cal);
  </code></pre>
  
  <p><code>certificates</code> is the list used to verify <code>certs</code> (<code>certificates</code> are trusted certificates). In the example, it's created from the next files:</p>
  
  <pre><code>public const String ADOBE = "../../../../resources/adobeRootCA.cer";
  public const String CACERT = "../../../../resources/CACertSigningAuthority.crt";
  public const String BRUNO = "../../../../resources/bruno.crt";
  </code></pre>
  
  <p>I'm not sure where should I get those files from when trying to implement this myself.<br>
  I'm thinking of verifying the signatures certificates against trusted certificates in Windows store, but since I don't get why the example uses those files, I'm not sure if verifying against Windows store would be ok.</p>