diff options
author | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-15 09:53:36 +0200 |
---|---|---|
committer | Andreas Fitzek <andreas.fitzek@iaik.tugraz.at> | 2014-07-15 09:53:36 +0200 |
commit | 8eecd5504d82b4827dda5b0549e0662051f37df2 (patch) | |
tree | d1cde5bede36b68f3b3c65b180c040da4d4801d1 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper | |
parent | 52123b59a26051ef01c0e33e5f55faa7e232f65a (diff) | |
download | pdf-as-4-8eecd5504d82b4827dda5b0549e0662051f37df2.tar.gz pdf-as-4-8eecd5504d82b4827dda5b0549e0662051f37df2.tar.bz2 pdf-as-4-8eecd5504d82b4827dda5b0549e0662051f37df2.zip |
Verification Level for verification after signature
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java index c2cee9c6..23335268 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsParameterExtractor.java @@ -25,6 +25,8 @@ package at.gv.egiz.pdfas.web.helper; import javax.servlet.http.HttpServletRequest; +import at.gv.egiz.pdfas.lib.api.verify.VerifyParameter.SignatureVerificationLevel; + public class PdfAsParameterExtractor { public static final String PARAM_CONNECTOR = "connector"; @@ -35,6 +37,11 @@ public class PdfAsParameterExtractor { public static final String PARAM_INVOKE_URL = "invoke-app-url"; public static final String PARAM_INVOKE_URL_TARGET = "invoke-app-url-target"; public static final String PARAM_INVOKE_URL_ERROR = "invoke-app-error-url"; + + public static final String PARAM_VERIFY_LEVEL = "verify-level"; + public static final String PARAM_VERIFY_LEVEL_OPTION_FULL = "full"; + public static final String PARAM_VERIFY_LEVEL_OPTION_INT_ONLY = "intOnly"; + public static final String PARAM_LOCALE = "locale"; public static final String PARAM_NUM_BYTES = "num-bytes"; public static final String PARAM_PDF_URL = "pdf-url"; @@ -65,6 +72,18 @@ public class PdfAsParameterExtractor { return (String)request.getAttribute(PARAM_INVOKE_URL); } + public static SignatureVerificationLevel getVerificationLevel(HttpServletRequest request) { + String value = (String)request.getAttribute(PARAM_VERIFY_LEVEL); + if(value != null) { + if(value.equals(PARAM_VERIFY_LEVEL_OPTION_FULL)) { + return SignatureVerificationLevel.FULL_VERIFICATION; + } else if(value.equals(PARAM_VERIFY_LEVEL_OPTION_INT_ONLY)) { + return SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION; + } + } + return SignatureVerificationLevel.INTEGRITY_ONLY_VERIFICATION; + } + public static String getInvokeTarget(HttpServletRequest request) { return (String)request.getAttribute(PARAM_INVOKE_URL_TARGET); } |