aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-common
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-30 17:25:31 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2014-10-30 17:25:31 +0100
commitd82c9837a3f7c250ed116487ab874b6825562e1f (patch)
tree559065142b1483eff007223aeca134a9e386649c /pdf-as-common
parentfb3344c1e4d4ac8e8a6aa5605d052cee8cd4c3b1 (diff)
downloadpdf-as-4-d82c9837a3f7c250ed116487ab874b6825562e1f.tar.gz
pdf-as-4-d82c9837a3f7c250ed116487ab874b6825562e1f.tar.bz2
pdf-as-4-d82c9837a3f7c250ed116487ab874b6825562e1f.zip
added Option to keep invalid signatures
Diffstat (limited to 'pdf-as-common')
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java1
-rw-r--r--pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java19
2 files changed, 20 insertions, 0 deletions
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
index 8ab02028..cf57f742 100644
--- a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/exceptions/ErrorConstants.java
@@ -3,6 +3,7 @@ package at.gv.egiz.pdfas.common.exceptions;
public interface ErrorConstants {
public static final String STATUS_INFO_SIGDEVICE = "SigDevice";
public static final String STATUS_INFO_SIGDEVICEVERSION = "SigDeviceVersion";
+ public static final String STATUS_INFO_INVALIDSIG = "InvalidSignature";
// Code below 10000 are reserved for SL Error Codes
diff --git a/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java
new file mode 100644
index 00000000..7628406d
--- /dev/null
+++ b/pdf-as-common/src/main/java/at/gv/egiz/pdfas/common/utils/SettingsUtils.java
@@ -0,0 +1,19 @@
+package at.gv.egiz.pdfas.common.utils;
+
+import at.gv.egiz.pdfas.common.settings.ISettings;
+
+public class SettingsUtils {
+ public static boolean getBooleanValue(ISettings setting, String key, boolean defaultValue) {
+ String theValue = setting.getValue(key);
+ if(theValue != null) {
+ if(theValue.equals("true")) {
+ return true;
+ } else if(theValue.equals("false")) {
+ return false;
+ } else {
+ return defaultValue;
+ }
+ }
+ return defaultValue;
+ }
+}