title: Fail to verify if a pdf is digital signed with iText
body: <p>I have a basic test class that use iText for check if a PDF document has a digital signature in it, this is the code:</p>
  
  <pre><code>private int getNumFirme(String path)
      {
          try
          {
              java.nio.file.Path pathF = Paths.get(path);
              byte [] bytes =  Files.readAllBytes(pathF);
              PdfReader reader = new PdfReader(bytes);
              pathF = null;
              int nFirme = reader.getAcroFields().getSignatureNames().size();
              reader.close();
              return nFirme;
          } catch (IOException e) { 
              e.printStackTrace();
              return -1;
          }
      }
  </code></pre>
  
  <p>This little method has alwyas worked, except for a particular pdf document.
  When I use the method for that document the result is 0 (no sign), when I open it with Adobe Acrobat it seems not have any signature (no popup like: "all the signature has verified" or "Almost one signature has problems") and even in the metadata there are no indication of a signature but if I open the file with Dike and I verify it, it contains the digital signature data.</p>
  
  <p>I have read on the Internet that the problem maybe to be that this pdf was signed with a CAdES signature (I'm not an expert of digital signatures and I don't know well the different with the 'normal' PAdES signature) and so the check fails, but I also read that a file signed with a CAdES signature normally has the ".p7m" extension.</p>
  
  <p>It's possible that the documen is signed with a CAdES sign and it has a ".pdf" extesion? Or maybe there is another problem?
  In case of the CAdES sign is the problem, how can I verify the signature on the document? (I don't want to know if the signature is valid, I want only to know if the document is signed or not)</p>
  
  <p>Thanks in advice for the help and sorry for my not perfect English</p>