From 3c4eac027bfd68bfce63a2eed010ccc2b7310802 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Thu, 16 Oct 2014 09:43:49 +0200 Subject: PreProcessor Interface added and API rebuild --- .../java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java | 2 +- .../at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java | 10 ++++++++-- .../main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java | 3 ++- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java index ce19f803..7900dfde 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/ExternSignServlet.java @@ -302,7 +302,7 @@ public class ExternSignServlet extends HttpServlet { PdfAsHelper.startSignature(request, response, getServletContext(), pdfData, connector, PdfAsHelper.buildPosString(request, response), transactionId, PdfAsParameterExtractor - .getSigType(request)); + .getSigType(request), PdfAsParameterExtractor.getPreProcessorMap(request)); return; } else if (connector.equals("jks") || connector.equals("moa")) { // start synchronous siganture creation diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java index 544f6c83..e602a8e0 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/UIEntryPointServlet.java @@ -24,6 +24,7 @@ package at.gv.egiz.pdfas.web.servlets; import java.io.IOException; +import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -147,12 +148,17 @@ public class UIEntryPointServlet extends HttpServlet { "Invalid connector mobilebku is not supported"); } } - + Map map = null; + if(pdfAsRequest.getParameters().getPreprocessor() != null) { + map = pdfAsRequest.getParameters().getPreprocessor().getMap(); + } + PdfAsHelper.startSignature(req, resp, getServletContext(), pdfAsRequest.getInputData(), connector.toString(), pdfAsRequest.getParameters().getPosition(), pdfAsRequest.getParameters().getTransactionId(), - pdfAsRequest.getParameters().getProfile()); + pdfAsRequest.getParameters().getProfile(), + map); } else { throw new PdfAsWebException("Invalid connector (" + Connector.BKU + " | " + Connector.ONLINEBKU + " | " diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java index 09af4357..aaa6afbb 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/VerifyServlet.java @@ -254,7 +254,8 @@ public class VerifyServlet extends HttpServlet { logger.debug("Format: " + format); - List results = PdfAsHelper.synchornousVerify(pdfData, -1, lvl); + List results = PdfAsHelper.synchornousVerify(pdfData, -1, lvl, + PdfAsParameterExtractor.getPreProcessorMap(request)); PdfAsHelper.setVerificationResult(request, results); -- cgit v1.2.3