aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-pdfbox/src/main/java/at
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-30 16:10:41 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-30 16:10:41 +0100
commite123b037e65b336c677c0a66125ae85f5827417a (patch)
treecbd4aa77832d99d132729b5c1772bf424f5c42c3 /pdf-as-pdfbox/src/main/java/at
parentf7f26464825033484cadff11658ae90b425c756c (diff)
downloadpdf-as-4-e123b037e65b336c677c0a66125ae85f5827417a.tar.gz
pdf-as-4-e123b037e65b336c677c0a66125ae85f5827417a.tar.bz2
pdf-as-4-e123b037e65b336c677c0a66125ae85f5827417a.zip
NPE when processing Signature fields, sig fields without dictionary
Diffstat (limited to 'pdf-as-pdfbox/src/main/java/at')
-rw-r--r--pdf-as-pdfbox/src/main/java/at/gv/egiz/pdfas/lib/impl/signing/pdfbox/PADESPDFBOXSigner.java21
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;
+ }
+ }
}
}
}