aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-04-29 12:13:11 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-04-29 12:13:11 +0000
commit6235c94885caefc238775946d5c775bba98c97b4 (patch)
tree44eb2b78e8c889ce011c2adf26d0da0a26a929d4 /src/main/java/at/gv/egiz
parent620f4f25941188360f64447b9d773a310866f70b (diff)
downloadpdf-as-3-6235c94885caefc238775946d5c775bba98c97b4.tar.gz
pdf-as-3-6235c94885caefc238775946d5c775bba98c97b4.tar.bz2
pdf-as-3-6235c94885caefc238775946d5c775bba98c97b4.zip
a) Two stage verification (analysis and verification) now throws PDFDocumentException(ErrorCode.DOCUMENT_NOT_SIGNED,...) if necessary. b) Do not try to remove svn-metadata while clearing temporary directory any more (preventing annoying error message).REL-3.0.5-rev260@260
git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@259 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java7
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/vfilter/VerificationFilterImpl.java4
2 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
index f0c85d4..ce6f776 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java
@@ -47,6 +47,7 @@ import at.gv.egiz.pdfas.impl.vfilter.VerificationFilterParametersImpl;
import at.knowcenter.wag.egov.egiz.PdfAS;
import at.knowcenter.wag.egov.egiz.PdfASID;
import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
+import at.knowcenter.wag.egov.egiz.exceptions.PDFDocumentException;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
@@ -369,6 +370,12 @@ public class PdfAsObject implements PdfAs
CheckHelper.checkVerifyAfterAnalysisParameters(verifyAfterAnalysisParameters);
List signatures = verifyAfterAnalysisParameters.getAnalyzeResult().getSignatures();
+
+ // added by tknall
+ if (signatures == null || signatures.isEmpty()) {
+ throw new PDFDocumentException(ErrorCode.DOCUMENT_NOT_SIGNED, "PDF document not signed."); //$NON-NLS-1$
+ }
+
List signature_holders = new ArrayList(signatures.size());
Iterator it = signatures.iterator();
while (it.hasNext())
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/vfilter/VerificationFilterImpl.java b/src/main/java/at/gv/egiz/pdfas/impl/vfilter/VerificationFilterImpl.java
index 81b0364..d353b9a 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/vfilter/VerificationFilterImpl.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/vfilter/VerificationFilterImpl.java
@@ -135,12 +135,10 @@ public class VerificationFilterImpl implements VerificationFilter
}
- log.trace("extractSignaturHolders finished.");
+ log.trace("extractSignaturHolders finished (" + (signatureHolderChain != null ? signatureHolderChain.size() : 0) + " elements).");
sw.stop();
log.debug("extractSignatureHolders: " + sw.getTime() + "ms.");
-
-
return signatureHolderChain;
}