aboutsummaryrefslogtreecommitdiff
path: root/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
diff options
context:
space:
mode:
authorAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-01-23 11:01:20 +0100
committerAndreas Fitzek <andreas.fitzek@iaik.tugraz.at>2015-01-23 11:01:20 +0100
commit01b1abedb9f5beb97df777605412d84a5bb63d7d (patch)
tree626a25399a506b7af6ff8f45b5d7011e3a3519a8 /pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
parentb8d5fc86a5f549cfb42736c8889fa548e6b6f661 (diff)
downloadpdf-as-4-01b1abedb9f5beb97df777605412d84a5bb63d7d.tar.gz
pdf-as-4-01b1abedb9f5beb97df777605412d84a5bb63d7d.tar.bz2
pdf-as-4-01b1abedb9f5beb97df777605412d84a5bb63d7d.zip
extended PDF-AS-WEB to support multiple Software Keystores
Diffstat (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java')
-rw-r--r--pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java76
1 files changed, 58 insertions, 18 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
index c16eec27..46430724 100644
--- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
+++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/config/WebConfiguration.java
@@ -54,12 +54,22 @@ public class WebConfiguration implements IConfigurationConstants {
public static final String RELOAD_PASSWORD = "reload.pwd";
public static final String RELOAD_ENABLED = "reload.enabled";
- public static final String KEYSTORE_ENABLED = "ks.enabled";
- public static final String KEYSTORE_FILE = "ks.file";
- public static final String KEYSTORE_TYPE = "ks.type";
- public static final String KEYSTORE_PASS = "ks.pass";
- public static final String KEYSTORE_ALIAS = "ks.key.alias";
- public static final String KEYSTORE_KEY_PASS = "ks.key.pass";
+ public static final String KEYSTORE_LIST = "ksl";
+ public static final String KEYSTORE_DEFAULT = "ks";
+
+ public static final String KEYSTORE_ENABLED = "enabled";
+ public static final String KEYSTORE_FILE = "file";
+ public static final String KEYSTORE_TYPE = "type";
+ public static final String KEYSTORE_PASS = "pass";
+ public static final String KEYSTORE_ALIAS = "key.alias";
+ public static final String KEYSTORE_KEY_PASS = "key.pass";
+
+ public static final String KEYSTORE_DEFAULT_ENABLED = KEYSTORE_DEFAULT + "." + KEYSTORE_ENABLED;
+ public static final String KEYSTORE_DEFAULT_FILE = KEYSTORE_DEFAULT + "." + KEYSTORE_FILE;
+ public static final String KEYSTORE_DEFAULT_TYPE = KEYSTORE_DEFAULT + "." + KEYSTORE_TYPE;
+ public static final String KEYSTORE_DEFAULT_PASS = KEYSTORE_DEFAULT + "." + KEYSTORE_PASS;
+ public static final String KEYSTORE_DEFAULT_ALIAS = KEYSTORE_DEFAULT + "." + KEYSTORE_ALIAS;
+ public static final String KEYSTORE_DEFAULT_KEY_PASS = KEYSTORE_DEFAULT + "." + KEYSTORE_KEY_PASS;
public static final String WHITELIST_ENABLED = "whitelist.enabled";
public static final String WHITELIST_VALUE_PRE = "whitelist.url.";
@@ -202,24 +212,44 @@ public class WebConfiguration implements IConfigurationConstants {
return properties.getProperty(PDF_AS_WORK_DIR);
}
- public static String getKeystoreFile() {
- return properties.getProperty(KEYSTORE_FILE);
+ public static String getKeystoreDefaultFile() {
+ return properties.getProperty(KEYSTORE_DEFAULT_FILE);
+ }
+
+ public static String getKeystoreDefaultType() {
+ return properties.getProperty(KEYSTORE_DEFAULT_TYPE);
+ }
+
+ public static String getKeystoreDefaultPass() {
+ return properties.getProperty(KEYSTORE_DEFAULT_PASS);
+ }
+
+ public static String getKeystoreDefaultAlias() {
+ return properties.getProperty(KEYSTORE_DEFAULT_ALIAS);
+ }
+
+ public static String getKeystoreDefaultKeyPass() {
+ return properties.getProperty(KEYSTORE_DEFAULT_KEY_PASS);
+ }
+
+ public static String getKeystoreFile(String keyIdentifier) {
+ return properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_FILE);
}
- public static String getKeystoreType() {
- return properties.getProperty(KEYSTORE_TYPE);
+ public static String getKeystoreType(String keyIdentifier) {
+ return properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_TYPE);
}
- public static String getKeystorePass() {
- return properties.getProperty(KEYSTORE_PASS);
+ public static String getKeystorePass(String keyIdentifier) {
+ return properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_PASS);
}
- public static String getKeystoreAlias() {
- return properties.getProperty(KEYSTORE_ALIAS);
+ public static String getKeystoreAlias(String keyIdentifier) {
+ return properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_ALIAS);
}
- public static String getKeystoreKeyPass() {
- return properties.getProperty(KEYSTORE_KEY_PASS);
+ public static String getKeystoreKeyPass(String keyIdentifier) {
+ return properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_KEY_PASS);
}
public static boolean getMOASSEnabled() {
@@ -232,8 +262,18 @@ public class WebConfiguration implements IConfigurationConstants {
return false;
}
- public static boolean getKeystoreEnabled() {
- String value = properties.getProperty(KEYSTORE_ENABLED);
+ public static boolean getKeystoreDefaultEnabled() {
+ String value = properties.getProperty(KEYSTORE_DEFAULT_ENABLED);
+ if (value != null) {
+ if (value.equals("true")) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean getKeystoreEnabled(String keyIdentifier) {
+ String value = properties.getProperty(KEYSTORE_LIST + "." + keyIdentifier + "." + KEYSTORE_ENABLED);
if (value != null) {
if (value.equals("true")) {
return true;