diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-02-25 13:45:34 +0100 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2015-02-25 13:45:34 +0100 |
commit | dbd565ec8195117306ae869f4e7b507ff275ed32 (patch) | |
tree | c2861cab1fe17a50464aec710ecdf7f52b5862c4 | |
parent | d420ee89e58d271e3f5ab202309e659f709fd0f5 (diff) | |
download | einfach-signieren-dbd565ec8195117306ae869f4e7b507ff275ed32.tar.gz einfach-signieren-dbd565ec8195117306ae869f4e7b507ff275ed32.tar.bz2 einfach-signieren-dbd565ec8195117306ae869f4e7b507ff275ed32.zip |
added QR Code generation + Base64 Data provising
7 files changed, 247 insertions, 56 deletions
diff --git a/simpleSigning/build.gradle b/simpleSigning/build.gradle index 07f6a20..1bf4cf2 100644 --- a/simpleSigning/build.gradle +++ b/simpleSigning/build.gradle @@ -34,6 +34,7 @@ dependencies { compile "commons-codec:commons-codec:1.9" //compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '1.8.5' compile 'com.lowagie:itext:4.2.0' + compile 'com.thetransactioncompany:cors-filter:2.2.1' providedCompile 'javax.servlet:javax.servlet-api:3.1.0' testCompile group: 'junit', name: 'junit', version: '4.+' } diff --git a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java index e018499..5c3927e 100644 --- a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java +++ b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/StartSignature.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.codec.binary.Base64; import org.apache.commons.fileupload.FileItemIterator; import org.apache.commons.fileupload.FileItemStream; import org.apache.commons.fileupload.servlet.ServletFileUpload; @@ -40,6 +41,7 @@ public class StartSignature extends HttpServlet { private static final String PARAM_TARGETURL = "TARGETURL"; private static final String PARAM_RESIZE = "RESIZE"; + private static final String PARAM_QRCODE = "QRCODE"; private static final String PARAM_NEW = "NEW"; private static final String PARAM_NEW_V = "1"; @@ -80,7 +82,7 @@ public class StartSignature extends HttpServlet { FileItemStream fileItem = iter.next(); if ("pdf-file".equals(fileItem.getFieldName())) { uploadForm = IOUtils.toByteArray(fileItem.openStream()); - if(uploadForm.length > 5) { + if (uploadForm.length > 5) { SessionHelper.setDocument(req, uploadForm); } else { logger.info("No Document uploaded"); @@ -133,6 +135,7 @@ public class StartSignature extends HttpServlet { String eventId = req.getParameter(PARAM_EVENTID); String type = req.getParameter(PARAM_TYPE); String targetUrl = req.getParameter(PARAM_TARGETURL); + String qrCodeData = req.getParameter(PARAM_QRCODE); // Step 1. Setup Parameters if (type != null) { @@ -143,6 +146,14 @@ public class StartSignature extends HttpServlet { + "]: setting Type to: " + type); } + if (qrCodeData != null) { + // If we have a type set it + SessionHelper.setQRCodeContent(req, qrCodeData); + + logger.info("[" + req.getSession().getId() + + "]: setting QR Code Data to: " + qrCodeData); + } + if (eventId != null) { SessionHelper.setEventID(req, eventId); @@ -169,14 +180,15 @@ public class StartSignature extends HttpServlet { SessionHelper.setContent(req, content); logger.info("[" + req.getSession().getId() + "]: setting Content"); - - + if (SessionHelper.getType(req).equals(Type.TEXT)) { SessionHelper.setDocument(req, PDFHelper.createPDFDocument(content)); + } else if (SessionHelper.getType(req).equals(Type.B64)) { + SessionHelper + .setDocument(req, Base64.decodeBase64(content)); } - } if ((SessionHelper.getContent(req) == null && SessionHelper @@ -218,19 +230,22 @@ public class StartSignature extends HttpServlet { bkusel = FileUtils.readFileToString(FileUtils .toFile(PDFASJsServlet.class .getResource("/html/submit"))); - - if (SessionHelper.getType(req) != null && - SessionHelper.getType(req).equals(Type.PDF)) { - bkusel = bkusel.replace("##REPLACE##NAME##", "Dokument signieren"); + + if (SessionHelper.getType(req) != null + && SessionHelper.getType(req).equals(Type.PDF)) { + bkusel = bkusel.replace("##REPLACE##NAME##", + "Dokument signieren"); } else { - bkusel = bkusel.replace("##REPLACE##NAME##", "Text signieren"); + bkusel = bkusel.replace("##REPLACE##NAME##", + "Text signieren"); } - + } form = form.replace("##REPLACE##BKUSEL##", bkusel); form = form.replace("##ACTIONURL##", - Configuration.getPublicUrl() + "/Start;jsessionid=" + req.getSession().getId()); + Configuration.getPublicUrl() + "/Start;jsessionid=" + + req.getSession().getId()); String resize = FileUtils.readFileToString(FileUtils .toFile(PDFASJsServlet.class @@ -257,20 +272,21 @@ public class StartSignature extends HttpServlet { } // Resize Iframe for BKU communication - + String resizeDone = req.getParameter(PARAM_RESIZE); - - if(resizeDone != null && resizeDone.equals("1")) { + + if (resizeDone != null && resizeDone.equals("1")) { SessionHelper.setResizeDone(req); } - - if(!SessionHelper.getResizeDone(req)) { + + if (!SessionHelper.getResizeDone(req)) { String form = FileUtils.readFileToString(FileUtils .toFile(PDFASJsServlet.class .getResource("/html/resize_form.html"))); form = form.replace("##ACTIONURL##", - Configuration.getPublicUrl() + "/Start;jsessionid=" + req.getSession().getId()); - + Configuration.getPublicUrl() + "/Start;jsessionid=" + + req.getSession().getId()); + String resize = FileUtils.readFileToString(FileUtils .toFile(PDFASJsServlet.class .getResource("/js/resizing_response.js"))); @@ -280,26 +296,20 @@ public class StartSignature extends HttpServlet { resize = resize.replace("##REPLACE##TARGETURL##", SessionHelper.getTargetURL(req)); - // Handy Signatur: style="width: 255px; height: 250px;" - + // Online BKU: width: 225px; height: 225px; - - if(SessionHelper.getConnector(req).equals("mobilebku")) { - resize = resize.replace("##REPLACE##HEIGHT##", - "255"); - - resize = resize.replace("##REPLACE##WIDTH##", - "250"); + + if (SessionHelper.getConnector(req).equals("mobilebku")) { + resize = resize.replace("##REPLACE##HEIGHT##", "255"); + + resize = resize.replace("##REPLACE##WIDTH##", "250"); } else { - resize = resize.replace("##REPLACE##HEIGHT##", - "225"); - - resize = resize.replace("##REPLACE##WIDTH##", - "225"); + resize = resize.replace("##REPLACE##HEIGHT##", "225"); + + resize = resize.replace("##REPLACE##WIDTH##", "225"); } - - + String postman = FileUtils.readFileToString(FileUtils .toFile(PDFASJsServlet.class .getResource("/js/postman.js"))); @@ -307,15 +317,15 @@ public class StartSignature extends HttpServlet { String script_txt = postman + resize; form = form.replace("##REPLACE##SCRIPT##", script_txt); - + resp.setContentType("text/html"); OutputStream os = resp.getOutputStream(); os.write(form.getBytes()); os.close(); - + return; } - + // Step 4. Start Signature Process with PDF-AS String template = FileUtils.readFileToString(FileUtils @@ -358,7 +368,15 @@ public class StartSignature extends HttpServlet { } } } - + String entry = ""; + if (SessionHelper.getQRCodeContent(req) != null) { + entry = "<input type=\"hidden\" name=\"qrcontent\" value=\"" + + SessionHelper.getQRCodeContent(req) + "\">"; + } + + template = template.replace("##ADDITIONAL##", + entry); + template = template.replace("##PDFASURL##", Configuration.getPDFAsLocation() + "/Sign"); template = template.replace("##INVOKEURL##", @@ -379,11 +397,8 @@ public class StartSignature extends HttpServlet { } catch (Throwable e) { logger.error("[" + req.getSession().getId() + "]: Something went wrong", e); - PDFHelper.toError( - req, - resp, - "Something went wrong", - e.getMessage()); + PDFHelper + .toError(req, resp, "Something went wrong", e.getMessage()); } } } diff --git a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java index 8815b87..720c93c 100644 --- a/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java +++ b/simpleSigning/src/main/java/at/gv/egiz/simpleSigning/helper/SessionHelper.java @@ -16,20 +16,25 @@ public class SessionHelper { private static final String SESSION_DOCUMENT = "SESSION_DOCUMENT"; private static final String SESSION_RESIZE_DONE = "SESSION_RESIZE_DONE"; + private static final String SESSION_QRCODE_CONTENT = "SESSION_QRCODE_CONTENT"; + private static final String SESSION_TYPE_TEXT = "TEXT"; private static final String SESSION_TYPE_PDF = "PDF"; + private static final String SESSION_TYPE_BASE64 = "B64"; private static final Logger logger = LoggerFactory .getLogger(SessionHelper.class); public enum Type { - TEXT, PDF + TEXT, PDF, B64 } public static void setType(HttpServletRequest request, String value) { if (value != null) { if (value.equals(SESSION_TYPE_PDF)) { request.getSession().setAttribute(SESSION_TYPE, Type.PDF); + } else if (value.equals(SESSION_TYPE_BASE64)) { + request.getSession().setAttribute(SESSION_TYPE, Type.B64); } else { request.getSession().setAttribute(SESSION_TYPE, Type.TEXT); } @@ -47,6 +52,19 @@ public class SessionHelper { } } + public static void setQRCodeContent(HttpServletRequest request, String value) { + request.getSession().setAttribute(SESSION_QRCODE_CONTENT, value); + } + + public static String getQRCodeContent(HttpServletRequest request) { + Object s = request.getSession().getAttribute(SESSION_QRCODE_CONTENT); + if (s != null) { + return s.toString(); + } else { + return null; + } + } + public static void setContent(HttpServletRequest request, String value) { request.getSession().setAttribute(SESSION_CONTENT, value); } diff --git a/simpleSigning/src/main/resources/html/template_start.html b/simpleSigning/src/main/resources/html/template_start.html index 19e780b..9c48304 100644 --- a/simpleSigning/src/main/resources/html/template_start.html +++ b/simpleSigning/src/main/resources/html/template_start.html @@ -20,6 +20,7 @@ function onAnmeldeSubmit() { <input type="hidden" name="invoke-app-url" value="##INVOKEURL##"> <input type="hidden" name="invoke-app-url-target" value="##INVOKETARGET##"> <input type="hidden" name="invoke-app-error-url" value="##INVOKEERRORURL##"> + ##ADDITIONAL## </form> </body> </html> diff --git a/simpleSigning/src/main/resources/js/pdfas.js b/simpleSigning/src/main/resources/js/pdfas.js index 1017fee..30f27f9 100644 --- a/simpleSigning/src/main/resources/js/pdfas.js +++ b/simpleSigning/src/main/resources/js/pdfas.js @@ -37,11 +37,15 @@ var pdfAs = {}; * @returns */ pdfAs.signText = function(content, error, success) { - this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, "TEXT", success, error); + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "TEXT", success, error); }; pdfAs.signPdf = function(content, error, success) { - this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, "PDF", success, error); + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "PDF", success, error); +}; + +pdfAs.signPdfBase64 = function(content, error, success) { + this.createAsyncSignature(content.content, content.connector, content.uiId, pdfAsUrl, content.qrdata, "B64", success, error); }; pdfAs.getVersion = function(cb, err) { @@ -132,7 +136,7 @@ pdfAs.autoResize = function(eventId, height, width){ element.style.margin = '-' + element.scrollHeight / 2 + 'px 0 0 -' + element.scrollWidth / 2 + 'px'; }; -pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, type, success, error) { +pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, qrcode, type, success, error) { // generate EventID var eventId = guid(); @@ -142,7 +146,8 @@ pdfAs.createAsyncSignature = function(pdfUrl, connector, divID, pdfAsURL, type, EVENTID: eventId, TYPE: type, TARGETURL: document.URL, - NEW: "1" + NEW: "1", + QRCODE: qrcode }; /*var querystring = encodeQueryData(parameters); diff --git a/simpleSigning/src/main/webapp/WEB-INF/web.xml b/simpleSigning/src/main/webapp/WEB-INF/web.xml index 4e292a8..44aa624 100644 --- a/simpleSigning/src/main/webapp/WEB-INF/web.xml +++ b/simpleSigning/src/main/webapp/WEB-INF/web.xml @@ -8,6 +8,21 @@ <display-name>Simple Signing</display-name> <description>Simple Signing Application</description> + <filter> + <filter-name>CORS</filter-name> + <filter-class>com.thetransactioncompany.cors.CORSFilter</filter-class> + + <init-param> + <param-name>cors.allowOrigin</param-name> + <param-value>*</param-value> + </init-param> + </filter> + + <filter-mapping> + <filter-name>CORS</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <servlet> <servlet-name>PDFASJsServlet</servlet-name> <display-name>PDFASJsServlet</display-name> @@ -15,7 +30,7 @@ <servlet-class>at.gv.egiz.simpleSigning.PDFASJsServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <servlet> <servlet-name>StartSignature</servlet-name> <display-name>StartSignature</display-name> @@ -23,7 +38,7 @@ <servlet-class>at.gv.egiz.simpleSigning.StartSignature</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <servlet> <servlet-name>Provider</servlet-name> <display-name>Provider</display-name> @@ -31,7 +46,7 @@ <servlet-class>at.gv.egiz.simpleSigning.Provider</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <servlet> <servlet-name>JQueryServlet</servlet-name> <display-name>JQueryServlet</display-name> @@ -47,7 +62,7 @@ <servlet-class>at.gv.egiz.simpleSigning.FinishSignature</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <servlet> <servlet-name>ErrorSignature</servlet-name> <display-name>ErrorSignature</display-name> @@ -55,7 +70,7 @@ <servlet-class>at.gv.egiz.simpleSigning.ErrorSignature</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <servlet> <servlet-name>VersionServlet</servlet-name> <display-name>VersionServlet</display-name> @@ -63,7 +78,7 @@ <servlet-class>at.gv.egiz.simpleSigning.VersionServlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> - + <!-- Define mappings that are used by the servlet container to translate a particular request URI (context-relative) to a particular servlet. The examples below correspond to the servlet descriptions above. Thus, a request @@ -110,7 +125,7 @@ </session-config> <welcome-file-list> - <welcome-file>index.jsp</welcome-file> - </welcome-file-list> + <welcome-file>index.jsp</welcome-file> + </welcome-file-list> </web-app>
\ No newline at end of file diff --git a/simpleSigning/src/main/webapp/index.jsp b/simpleSigning/src/main/webapp/index.jsp index 9588789..f1da513 100644 --- a/simpleSigning/src/main/webapp/index.jsp +++ b/simpleSigning/src/main/webapp/index.jsp @@ -5,10 +5,143 @@ <script type="text/javascript" src="pdfas.js"></script> <script type="text/javascript"> + + var testpdf = "JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0ZpbHRlci9GbGF0ZURl" + + "Y29kZT4+CnN0cmVhbQp4nDPQM1Qo5ypUMABCM0MjBXNLI4WiVK5wLYU8qKi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"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" + + "y/MdVZZnn9lqWXzm+jMMpW98ptjkH/1zcuKpM08xqcdnHj/7ODvz2NnHmAvT89NMJlhrSU7ZLVMd" + + "2yycu3KwwM0OathlC430HrbV+COjHssoOh0aqrcMddRa1rlLB9VYrAodDayFbWF72CR7hp1nC7R9" + + "wSpLL34Xg9eDjKHH0uPqwRkueqJdViTan9o/s5/t9NdaAh27LIYOS4er43LHJx3XOjSjHeRF/Pgv" + + "+Of9rMdf6/J7/FVW/8aAebDCXT5odBsGGQKDxA2DLsOygTEYRg0nDKwBWoCZqSBqMkfOzg702+1d" + + "cwXLfV2SNnhIIiclWz89enqHJM1JCQaHDoVmCfmT8GOnT0Pbpi6poT8kRTaFu6QYCh4qzKBg3DRb" + + "AW3hTCZrp4PY7SgexSPYjyI0ksmDYF8xgz1DMhnIZIid2mQREcjYKUwRGkMwciQD9ECtdtmLSplM" + + "5ch/A/czZpsKZW5kc3RyZWFtCmVuZG9iagoKNiAwIG9iago0MTgzCmVuZG9iagoKNyAwIG9iago8" + + "PC9UeXBlL0ZvbnREZXNjcmlwdG9yL0ZvbnROYW1lL0JBQUFBQStMaWJlcmF0aW9uU2VyaWYKL0Zs" + + "YWdzIDQKL0ZvbnRCQm94Wy0xNzYgLTMwMyAxMDA1IDk4MV0vSXRhbGljQW5nbGUgMAovQXNjZW50" + + "IDg5MQovRGVzY2VudCAtMjE2Ci9DYXBIZWlnaHQgOTgxCi9TdGVtViA4MAovRm9udEZpbGUyIDUg" + + "MCBSCj4+CmVuZG9iagoKOCAwIG9iago8PC9MZW5ndGggMjQwL0ZpbHRlci9GbGF0ZURlY29kZT4+" +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RCQjJGMDRFQQo+PgpzdGFydHhyZWYKNTc3NAolJUVPRgo="; + function clearDiv() { document.getElementById("embedded").innerHTML = ""; document.getElementById("btnSign").disabled = false; } + + function signBase64WithQR() { + var op = { + content : testpdf, + qrdata: "http://goo.gl/wuAk6s" + }; + + pdfAs.signPdfBase64(op, function(code, msg) { + var element = document.getElementById("Error"); + element.innerHTML = "<p>Error: " + code + " (" + msg + ")</p>"; + element.style.display = "block"; + clearDiv(); + }, function(pdfurl) { + var element = document.getElementById("Result"); + element.innerHTML = "<a href=\"" + pdfurl + "\">ready</a>"; + element.style.display = "block"; + clearDiv(); + }); + // so we don't follow the form ... + return false; + } function signWidthContent() { @@ -141,6 +274,9 @@ <div class="form-group"> <button id="btnVersion" onclick="return showVersion();">zeige Version</button> </div> + <!-- div class="form-group"> + <button id="btnBase64" onclick="return signBase64WithQR();">sign B64 Content</button> + </div --> </form> </div> |