aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-27 13:39:27 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-11-27 13:39:27 +0000
commitd5a386b533a3e56006c13c875f6ee80a97569777 (patch)
tree4623eb04187c87912256d7b8f22a9e0259923d41 /src/main/java/at/gv/egiz
parent0a1b9548daabd8ed5b89b4e8dd8dfbd388d5d9c1 (diff)
downloadpdf-as-3-d5a386b533a3e56006c13c875f6ee80a97569777.tar.gz
pdf-as-3-d5a386b533a3e56006c13c875f6ee80a97569777.tar.bz2
pdf-as-3-d5a386b533a3e56006c13c875f6ee80a97569777.zip
serious bug in EGIZDate fixed (comparison was performed in 12-hour-mode, therefore sigs over noon were broken),
jce- and ecc-provider are now being registered in Settingsreader git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@231 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/vfilter/VerificationFilterImpl.java51
1 files changed, 32 insertions, 19 deletions
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 3fe17bf..bd5a146 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
@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import org.apache.commons.lang.time.StopWatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -63,6 +64,8 @@ public class VerificationFilterImpl implements VerificationFilter
public List extractSignatureHolders(final PdfDataSource pdf, List blocks, final VerificationFilterParameters parameters) throws VerificationFilterException
{
log.trace("extractSignaturHolders:");
+ StopWatch sw = new StopWatch();
+ sw.start();
if (log.isDebugEnabled())
{
@@ -72,20 +75,6 @@ public class VerificationFilterImpl implements VerificationFilter
unrollLinearization(blocks);
- // tzefferer: check document here
- SettingsReader settings;
- try {
- settings = SettingsReader.getInstance();
- } catch (SettingsException e) {
- throw new VerificationFilterException(e);
- }
- String check_doc = settings.getSetting(CHECK_DOCUMENT, "false");
-
- if(check_doc.equalsIgnoreCase("true")) {
- checkDocument(pdf, blocks, parameters);
- }
- // end add
-
if (log.isDebugEnabled())
{
log.debug("IU blocks without linearization: " + blocks.size());
@@ -122,8 +111,32 @@ public class VerificationFilterImpl implements VerificationFilter
}
}
-
+
log.trace("extractSignaturHolders finished.");
+ sw.stop();
+ log.debug("extractSignatureHolders: " + sw.getTime() + "ms.");
+
+ SettingsReader settings;
+ try {
+ settings = SettingsReader.getInstance();
+ } catch (SettingsException e) {
+ throw new VerificationFilterException(e);
+ }
+ String check_doc = settings.getSetting(CHECK_DOCUMENT, "false");
+
+ // tzefferer: check document here
+ // check doesn't make sense if we don't have any signatures
+ if (signatureHolderChain != null && !signatureHolderChain.isEmpty() && "true".equalsIgnoreCase(check_doc)) {
+ sw.reset();
+ sw.start();
+ checkDocument(pdf, blocks, parameters);
+ sw.stop();
+ log.debug("checkDocument: " + sw.getTime() + "ms.");
+ } else {
+ log.debug("Skipping checkDocument.");
+ }
+ // end add
+
return signatureHolderChain;
}
@@ -571,7 +584,7 @@ public class VerificationFilterImpl implements VerificationFilter
boolean sig_detected = false;
- if(considerOldSigs) {
+ if (considerOldSigs) {
DelimitedPdfDataSource dds = new DelimitedPdfDataSource(pdf, pdf.getLength());
String text = null;
@@ -583,7 +596,7 @@ public class VerificationFilterImpl implements VerificationFilter
SignaturesAndOld sao = extractSignaturesAndOld(text);
- if((sao != null)&&(sao.oldSignature != null)) {
+ if ((sao != null) && (sao.oldSignature != null)) {
sig_detected = true;
}
}
@@ -591,7 +604,7 @@ public class VerificationFilterImpl implements VerificationFilter
Iterator it = blocks.iterator();
String prev_text = null;
-
+
while (it.hasNext())
{
boolean sig_in_current_block = false;
@@ -607,7 +620,7 @@ public class VerificationFilterImpl implements VerificationFilter
throw new VerificationFilterException(e);
}
- if(prev_text == null) {
+ if (prev_text == null) {
prev_text = text;
} else {
String texttmp = text.substring(prev_text.length());