Signature Verification
Contents
[
Hide
]
Verify PDF signature
Use this workflow when you need a quick validation pass over an existing signed PDF.
Steps
- Create a
PdfFileSignatureinstance and bind the signed PDF. - Select the signature name you want to inspect.
- Call
verifySignatureto validate the signature. - Call
coversWholeDocumentto check coverage. - Close the facade object.
Java example
public static void verifyPdfSignature(Path inputFile) {
PdfFileSignature pdfSignature = new PdfFileSignature();
try {
pdfSignature.bindPdf(inputFile.toString());
SignatureName signatureName = pdfSignature.getSignatureNames().get_Item(0);
System.out.println("Signature '" + signatureName + "' is valid: " + pdfSignature.verifySignature(signatureName));
System.out.println("Signature covers whole document: " + pdfSignature.coversWholeDocument(signatureName));
} finally {
pdfSignature.close();
}
}