diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-16 09:43:49 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-10-16 09:43:49 +0200 |
commit | 3c4eac027bfd68bfce63a2eed010ccc2b7310802 (patch) | |
tree | 507f8586045b57e4457da23ce7aedca6a497a913 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws | |
parent | 00894355450179bea4b56e0abcf16243964ff286 (diff) | |
download | pdf-as-4-3c4eac027bfd68bfce63a2eed010ccc2b7310802.tar.gz pdf-as-4-3c4eac027bfd68bfce63a2eed010ccc2b7310802.tar.bz2 pdf-as-4-3c4eac027bfd68bfce63a2eed010ccc2b7310802.zip |
PreProcessor Interface added and API rebuild
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java | 13 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java | 8 |
2 files changed, 17 insertions, 4 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java index 6df63a3b..d15492b4 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASSigningImpl.java @@ -25,6 +25,7 @@ package at.gv.egiz.pdfas.web.ws; import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.jws.WebService; import javax.xml.ws.WebServiceException; @@ -39,7 +40,6 @@ import at.gv.egiz.pdfas.api.ws.PDFASSignParameters.Connector; import at.gv.egiz.pdfas.api.ws.PDFASSignRequest; import at.gv.egiz.pdfas.api.ws.PDFASSignResponse; import at.gv.egiz.pdfas.api.ws.PDFASSigning; -import at.gv.egiz.pdfas.api.ws.PDFASVerificationResponse; import at.gv.egiz.pdfas.api.ws.VerificationLevel; import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter.SignatureVerificationLevel; import at.gv.egiz.pdfas.lib.api.verify.VerifyResult; @@ -79,6 +79,11 @@ public class PDFASSigningImpl implements PDFASSigning { "Invalid connector value!"); } + Map<String, String> preProcessor = null; + if(request.getParameters().getPreprocessor() != null) { + preProcessor = request.getParameters().getPreprocessor().getMap(); + } + if (request.getParameters().getConnector().equals(Connector.MOA) || request.getParameters().getConnector() .equals(Connector.JKS)) { @@ -94,7 +99,8 @@ public class PDFASSigningImpl implements PDFASSigning { .synchornousVerify( response.getSignedPDF(), -1, - SignatureVerificationLevel.FULL_VERIFICATION); + SignatureVerificationLevel.FULL_VERIFICATION, + preProcessor); if (verResults.size() != 1) { throw new WebServiceException( @@ -106,7 +112,8 @@ public class PDFASSigningImpl implements PDFASSigning { .synchornousVerify( response.getSignedPDF(), -1, - SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION); + SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION, + preProcessor); if (verResults.size() != 1) { throw new WebServiceException( diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java index c6fb8cd7..0257f835 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/ws/PDFASVerificationImpl.java @@ -4,6 +4,7 @@ import iaik.x509.X509Certificate; import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.jws.WebService; import javax.xml.ws.WebServiceException; @@ -44,6 +45,11 @@ public class PDFASVerificationImpl implements PDFASVerification { sigIdx = request.getSignatureIndex().intValue(); } + Map<String, String> preProcessor = null; + if(request.getPreprocessor() != null) { + preProcessor = request.getPreprocessor().getMap(); + } + SignatureVerificationLevel lvl = SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION; if (request.getVerificationLevel().equals( @@ -55,7 +61,7 @@ public class PDFASVerificationImpl implements PDFASVerification { } List<VerifyResult> results = PdfAsHelper.synchornousVerify( - request.getInputData(), sigIdx, lvl); + request.getInputData(), sigIdx, lvl, preProcessor); for(int i = 0; i < results.size(); i++) { VerifyResult result = results.get(i); |