aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid
diff options
context:
space:
mode:
authorknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-07-16 15:28:00 +0000
committerknowcenter <knowcenter@7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c>2007-07-16 15:28:00 +0000
commit784b2b91ee43310810dd7893f6f0ac404adba185 (patch)
tree1bf8b2f987fdbcd0f28a084681adfd587dc36874 /src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid
parent57e6d642bd6d1ab7bece6e9710c82d03e211084d (diff)
downloadpdf-as-3-784b2b91ee43310810dd7893f6f0ac404adba185.tar.gz
pdf-as-3-784b2b91ee43310810dd7893f6f0ac404adba185.tar.bz2
pdf-as-3-784b2b91ee43310810dd7893f6f0ac404adba185.zip
BKU and MOA signing templates versioning implemented.
See config.paramter file for changes/options git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@127 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c
Diffstat (limited to 'src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid')
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedIdFormatter.java26
-rw-r--r--src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedLocRefMOAIdFormatter.java17
2 files changed, 39 insertions, 4 deletions
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedIdFormatter.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedIdFormatter.java
index 25e4504..f951b47 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedIdFormatter.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedIdFormatter.java
@@ -6,16 +6,21 @@ package at.knowcenter.wag.egov.egiz.sig.sigid;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
+import at.knowcenter.wag.egov.egiz.exceptions.SettingsException;
+
/**
* @author wprinz
*
*/
public class DetachedIdFormatter implements IdFormatter
{
+ // last change: erno & arian; 16.07.2007 13:17
+ public static final String DEFAULT_BKU_SIG_ID = "default.bku.signature.id";
/**
* The SIG_ID prefix.
*/
- public static final String SIG_ID_PREFIX = "etsi-bku-detached"; //$NON-NLS-1$
+ public static String SIG_ID_PREFIX = null;
/**
* The log.
@@ -27,6 +32,10 @@ public class DetachedIdFormatter implements IdFormatter
*/
public String formatIds(String[] ids)
{
+ // if SIG_ID_PREFIX null is, call read the config file and set the value from it
+ if(SIG_ID_PREFIX == null)
+ setPrefixId();
+
// ids algorithm:
String join = ""; //$NON-NLS-1$
String base = null;
@@ -54,5 +63,18 @@ public class DetachedIdFormatter implements IdFormatter
String final_ids = SIG_ID_PREFIX + "@" + idstr;
return final_ids;
}
-
+
+ /*
+ * Read configuration from file and set it to global variable
+ */
+ public void setPrefixId()
+ {
+ try
+ {
+ SIG_ID_PREFIX = SettingsReader.getInstance().getValueFromKey(DEFAULT_BKU_SIG_ID);
+ } catch (SettingsException e)
+ {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedLocRefMOAIdFormatter.java b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedLocRefMOAIdFormatter.java
index f1060fb..5cfd4fb 100644
--- a/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedLocRefMOAIdFormatter.java
+++ b/src/main/java/at/knowcenter/wag/egov/egiz/sig/sigid/DetachedLocRefMOAIdFormatter.java
@@ -3,6 +3,9 @@
*/
package at.knowcenter.wag.egov.egiz.sig.sigid;
+import at.knowcenter.wag.egov.egiz.cfg.SettingsReader;
+import at.knowcenter.wag.egov.egiz.exceptions.SettingsException;
+
/**
* @author wprinz
*
@@ -12,14 +15,24 @@ public class DetachedLocRefMOAIdFormatter implements IdFormatter
/**
* The SIG_ID prefix.
*/
- public static final String SIG_ID_PREFIX = "etsi-moa-detached"; //$NON-NLS-1$
+ public static final String MOA_SIG_ID_KEY = "default.moa.signature.id";
/**
* @see at.knowcenter.wag.egov.egiz.sig.sigid.IdFormatter#formatIds(java.lang.String[])
*/
public String formatIds(String[] ids)
{
- return SIG_ID_PREFIX;
+ String sig_id_prefix = null;
+
+ try
+ {
+ sig_id_prefix = SettingsReader.getInstance().getValueFromKey(MOA_SIG_ID_KEY);
+ } catch (SettingsException e)
+ {
+ e.printStackTrace();
+ }
+
+ return sig_id_prefix;
}
}