SignatureUtil { public List<String> getSignatureNames() { if (sigNames != null) return new ArrayList<>(orderedSignatureNames); sigNames = new HashMap<>(); orderedSignatureNames = new ArrayList<>(); populateSignatureNames(); return new ArrayList<>(orderedSignatureNames); } SignatureUtil(PdfDocument document); @Deprecated static long[] asLongArray(PdfArray pdfArray); @Deprecated PdfPKCS7 verifySignature(String name); @Deprecated PdfPKCS7 verifySignature(String name, String provider); PdfPKCS7 readSignatureData(String signatureFieldName); PdfPKCS7 readSignatureData(String signatureFieldName, String securityProvider); PdfSignature getSignature(String name); PdfDictionary getSignatureDictionary(String name); List<String> getSignatureNames(); List<String> getBlankSignatureNames(); int getTotalRevisions(); int getRevision(String field); String getTranslatedFieldName(String name); InputStream extractRevision(String field); boolean signatureCoversWholeDocument(String name); boolean doesSignatureFieldExist(String name);  }
@Test public void getSignaturesTest01() throws IOException { String inPdf = sourceFolder + "simpleSignature.pdf"; PdfDocument pdfDocument = new PdfDocument(new PdfReader(inPdf)); SignatureUtil signatureUtil = new SignatureUtil(pdfDocument); List<String> signatureNames = signatureUtil.getSignatureNames(); Assert.assertEquals(1, signatureNames.size()); Assert.assertEquals("Signature1", signatureNames.get(0)); }
@Test public void getSignaturesTest02() throws IOException { String inPdf = sourceFolder + "simpleDocument.pdf"; PdfDocument pdfDocument = new PdfDocument(new PdfReader(inPdf)); SignatureUtil signatureUtil = new SignatureUtil(pdfDocument); List<String> signatureNames = signatureUtil.getSignatureNames(); Assert.assertEquals(0, signatureNames.size()); }