From a8183a22b3a5bd9b062a1cded09a75ec8fa3be8e Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 5 Feb 2014 10:30:30 +0100 Subject: Fixed signature data hash verification, Pdf Download document name --- .../at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 77c31c9a..12d7ffc5 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -64,6 +64,7 @@ public class PdfAsHelper { private static final String PDF_PDFDATA_PAGE = "/PDFData"; private static final String PDF_DATAURL_PAGE = "/DataURL"; private static final String PDF_ERR_URL = "PDF_ERR_URL"; + private static final String PDF_FILE_NAME = "PDF_FILE_NAME"; private static final String PDF_INVOKE_URL = "PDF_INVOKE_URL"; private static final String REQUEST_FROM_DU = "REQ_DATA_URL"; private static final String SIGNATURE_DATA_HASH = "SIGNATURE_DATA_HASH"; @@ -627,17 +628,33 @@ public class PdfAsHelper { } public static void setSignatureDataHash(HttpServletRequest request, String value) { - request.setAttribute(SIGNATURE_DATA_HASH, value); + HttpSession session = request.getSession(); + session.setAttribute(SIGNATURE_DATA_HASH, value); } public static String getSignatureDataHash(HttpServletRequest request) { - Object obj = request.getAttribute(SIGNATURE_DATA_HASH); + HttpSession session = request.getSession(); + Object obj = session.getAttribute(SIGNATURE_DATA_HASH); if (obj != null) { return obj.toString(); } return ""; } + public static void setPDFFileName(HttpServletRequest request, String value) { + HttpSession session = request.getSession(); + session.setAttribute(PDF_FILE_NAME, value); + } + + public static String getPDFFileName(HttpServletRequest request) { + HttpSession session = request.getSession(); + Object obj = session.getAttribute(PDF_FILE_NAME); + if (obj != null) { + return obj.toString(); + } + return "document.pdf"; + } + public static void setSignatureActive(HttpServletRequest request, boolean value) { request.setAttribute(SIGNATURE_ACTIVE, new Boolean(value)); } -- cgit v1.2.3