aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/pdfas/impl/api
diff options
context:
space:
mode:
authortknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-01-18 15:13:13 +0000
committertknall <tknall@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2008-01-18 15:13:13 +0000
commit877758d9ec4deb53aad8a6c1d8669cc7186b1a48 (patch)
tree97cbeef0ef915511f94782d2501b283b8a077e2e /src/main/java/at/gv/egiz/pdfas/impl/api
parent9770635e1bdcc3338468e9687545d5326a394630 (diff)
downloadpdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.tar.gz
pdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.tar.bz2
pdf-as-3-877758d9ec4deb53aad8a6c1d8669cc7186b1a48.zip
update dealing with incremental updates
(NoSignatureHolder introduced that indicates incremental updates. NoSignatureHolders are transported as SignatureHolder withing analysis but are finally removed to maintain compatibility. This allowes to show which signatures are followed by incremental updates containing no signature. If the last signature is followed by an incremental update, an exception is thrown to indicate an illegal modification. git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@248 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/impl/api')
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/PdfAsObject.java19
-rw-r--r--src/main/java/at/gv/egiz/pdfas/impl/api/analyze/AnalyzeResultImpl.java31
2 files changed, 45 insertions, 5 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 3b5d0a6..704f9fd 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
@@ -45,6 +45,7 @@ import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
import at.knowcenter.wag.egov.egiz.exceptions.PresentableException;
import at.knowcenter.wag.egov.egiz.exceptions.SignatureException;
import at.knowcenter.wag.egov.egiz.framework.SignatorFactory;
+import at.knowcenter.wag.egov.egiz.pdf.NoSignatureHolder;
import at.knowcenter.wag.egov.egiz.pdf.SignatureHolder;
import at.knowcenter.wag.egov.egiz.pdf.TablePos;
import at.knowcenter.wag.egov.egiz.sig.SignatureResponse;
@@ -268,16 +269,24 @@ public class PdfAsObject implements PdfAs
ExtractionStage es = new ExtractionStage();
List signature_holders = es.extractSignatureHolders(inputDataSource, parameters);
- List sigInfs = new ArrayList(signature_holders.size());
+// List sigInfs = new ArrayList(signature_holders.size());
+ List sigInfs = new ArrayList();
+ List noSigs = new ArrayList();
Iterator it = signature_holders.iterator();
while (it.hasNext())
{
SignatureHolder sh = (SignatureHolder)it.next();
- SignatureInformation si = new SignatureInformationAdapter(sh);
- sigInfs.add(si);
+
+ if(sh instanceof NoSignatureHolder) {
+ noSigs.add(sh);
+ } else {
+
+ SignatureInformation si = new SignatureInformationAdapter(sh);
+ sigInfs.add(si);
+ }
}
- return new AnalyzeResultImpl(sigInfs);
+ return new AnalyzeResultImpl(sigInfs, noSigs);
}
/**
@@ -308,7 +317,7 @@ public class PdfAsObject implements PdfAs
{
SignatureResponse response = (SignatureResponse) results.get(i);
SignatureHolder holder = (SignatureHolder) signature_holders.get(i);
-
+
VerifyResult vr = new VerifyResultAdapter(response, holder, verifyAfterAnalysisParameters.getVerificationTime());
vrs.add(vr);
}
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/api/analyze/AnalyzeResultImpl.java b/src/main/java/at/gv/egiz/pdfas/impl/api/analyze/AnalyzeResultImpl.java
index 87a14f0..7b1dffa 100644
--- a/src/main/java/at/gv/egiz/pdfas/impl/api/analyze/AnalyzeResultImpl.java
+++ b/src/main/java/at/gv/egiz/pdfas/impl/api/analyze/AnalyzeResultImpl.java
@@ -19,6 +19,32 @@ public class AnalyzeResultImpl implements AnalyzeResult
* The found signatures.
*/
protected List signatures = null;
+
+ /**
+ * The found non-signature update blocks.
+ */
+ protected List noSignatures = null;
+
+
+ /**
+ * Constructor.
+ *
+ * @param signatures
+ * The found signatures.
+ * @param noSignatures
+ * The found non-signature update blocks.
+ */
+ public AnalyzeResultImpl(List signatures, List noSignatures)
+ {
+ if (signatures == null)
+ {
+ throw new IllegalArgumentException("The list of found signatures must not be null.");
+ }
+
+ this.signatures = signatures;
+ this.noSignatures = noSignatures;
+ }
+
/**
* Constructor.
@@ -44,4 +70,9 @@ public class AnalyzeResultImpl implements AnalyzeResult
return this.signatures;
}
+ public List getNoSignatures() {
+
+ return this.noSignatures;
+ }
+
}