Skip to content

Instantly share code, notes, and snippets.

@rsatrio
Created May 7, 2022 22:54
Show Gist options
  • Save rsatrio/58af394606f49195e2fa5c648d2cec43 to your computer and use it in GitHub Desktop.
Save rsatrio/58af394606f49195e2fa5c648d2cec43 to your computer and use it in GitHub Desktop.
Check signature on PDF File
ByteArrayInputStream pdfBytes=new ByteArrayInputStream(
Files.readAllBytes(Paths.get(pdfFile.getAbsolutePath())));
pdfDoc=PDDocument.load(pdfFile);
pdfDoc.getSignatureDictionaries().forEach(signature-> {
try {
//Get PKCS#7 Data
CMSSignedData signedData=new CMSSignedData(signature.getContents());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment