diff options
-rw-r--r-- | pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java index 14082a10..655a144e 100644 --- a/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java +++ b/pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java @@ -131,10 +131,10 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { FileInputStream fis = new FileInputStream(new File(fisTmpFile)); doc = pdfObject.getDocument(); - + SignaturePlaceholderData signaturePlaceholderData = PlaceholderFilter - .checkPlaceholderSignature(pdfObject.getStatus(), - pdfObject.getStatus().getSettings()); + .checkPlaceholderSignature(pdfObject.getStatus(), pdfObject + .getStatus().getSettings()); TablePos tablePos = null; @@ -384,11 +384,16 @@ public class PADESPDFBOXSigner implements IPdfSigner, IConfigurationConstants { if (fields != null) { for (PDField pdField : fields) { - if (pdField instanceof PDSignatureField) { - if (((PDSignatureField) pdField).getSignature() - .getDictionary() - .equals(signature.getDictionary())) { - signatureField = (PDSignatureField) pdField; + if (pdField != null) { + if (pdField instanceof PDSignatureField) { + PDSignatureField tmpSigField = (PDSignatureField) pdField; + if (tmpSigField.getSignature() != null && + tmpSigField.getSignature().getDictionary() != null) { + if (tmpSigField.getSignature().getDictionary() + .equals(signature.getDictionary())) { + signatureField = (PDSignatureField) pdField; + } + } } } } |