aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java319
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java63
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java128
3 files changed, 249 insertions, 261 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
index 6c826ad..1b47013 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
@@ -42,6 +42,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.math.BigInteger;
import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.security.Principal;
import java.util.ArrayList;
import java.util.Arrays;
@@ -70,6 +71,7 @@ import at.gv.egovernment.moaspss.logging.Logger;
import at.gv.egovernment.moaspss.util.Constants;
import at.gv.egovernment.moaspss.util.DOMUtils;
import at.gv.egovernment.moaspss.util.FileUtils;
+import at.gv.egovernment.moaspss.util.MiscUtil;
import at.gv.egovernment.moaspss.util.StringUtils;
import at.gv.egovernment.moaspss.util.XPathUtils;
@@ -1220,238 +1222,105 @@ public class ConfigurationPartsBuilder {
*
* @return The profile ID to profile mapping.
*/
- public Map buildTrustProfiles(String tslWorkingDir)
+
+ public Map buildTrustProfiles()
{
Map trustProfiles = new HashMap();
NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_PROFILE_XPATH);
Element profileElem;
- while ((profileElem = (Element) profileIter.nextNode()) != null)
- {
- String id = getElementValue(profileElem, CONF + "Id", null);
- String trustAnchorsLocStr = getElementValue(profileElem, CONF + "TrustAnchorsLocation", null);
- String signerCertsLocStr = getElementValue(profileElem, CONF + "SignerCertsLocation", null);
- Element eutslElem = (Element) XPathUtils.selectSingleNode(profileElem, CONF + "EUTSL");
- boolean tslEnabled = false;
- if (eutslElem != null) //EUTSL element found --> TSL enabled
- tslEnabled = true;
-
- String countries = getElementValue(profileElem, CONF + "EUTSL" + "/" + CONF + "CountrySelection", null);
-
- URI trustAnchorsLocURI = null;
- try
- {
- trustAnchorsLocURI = new URI(trustAnchorsLocStr);
- if (!trustAnchorsLocURI.isAbsolute()) { // make it absolute to the config file
- trustAnchorsLocURI = new URI(configRoot_.toURL() + trustAnchorsLocStr);
- }
- }
- catch (URIException e) {
- warn("config.14", new Object[] { "uri", id, trustAnchorsLocStr }, e);
- continue;
- }
- catch (MalformedURLException e)
- {
- warn("config.15", new Object[] {id}, e);
- continue;
- }
-
- File profileDir = new File(trustAnchorsLocURI.getPath());
- if (!profileDir.exists() || !profileDir.isDirectory()) {
- warn("config.27", new Object[] { "uri", id });
- continue;
- }
-
-
-
- if (trustProfiles.containsKey(id)) {
- warn("config.04", new Object[] { "TrustProfile", id });
- continue;
- }
-
- URI signerCertsLocURI = null;
- if (signerCertsLocStr != null && !"".equals(signerCertsLocStr))
- {
+ while ((profileElem = (Element) profileIter.nextNode()) != null) {
+ //load basic TrustProfile information
+
+ //check TrustProfileId
+ String id = getElementValue(profileElem, CONF + "Id", null);
+ if (MiscUtil.isEmpty(id)) {
+ warn("config.52", new Object[]{"Id des TrustProfiles ist leer."});
+ continue;
+
+ }
+ //cast profileId to lowercase (changed in 3.0.1)
+ id = id.trim().toLowerCase();
+ if (trustProfiles.containsKey(id)) {
+ warn("config.04", new Object[] { "TrustProfile", id });
+ continue;
+ }
+
+ //check location of TrustAnchor directory
+ String trustAnchorsLocStr = getElementValue(profileElem, CONF + "TrustAnchorsLocation", null);
+ URI trustAnchorsLocURI = null;
try
{
- signerCertsLocURI = new URI(signerCertsLocStr);
- if (!signerCertsLocURI.isAbsolute()) signerCertsLocURI = new URI(configRoot_.toURL() + signerCertsLocStr);
-
- File signerCertsDir = new File(signerCertsLocURI.getPath());
- if (!signerCertsDir.exists() || !signerCertsDir.isDirectory()) {
- warn("config.27", new Object[] { "signerCertsUri", id });
- continue;
+ trustAnchorsLocURI = new URI(trustAnchorsLocStr);
+ if (!trustAnchorsLocURI.isAbsolute()) { // make it absolute to the config file
+ trustAnchorsLocURI = new URI(configRoot_.toURL() + trustAnchorsLocStr);
}
}
catch (URIException e) {
- warn("config.14", new Object[] { "signerCertsUri", id, trustAnchorsLocStr }, e);
+ warn("config.14", new Object[] { "uri", id, trustAnchorsLocStr }, e);
continue;
}
- catch (MalformedURLException e) {
+ catch (MalformedURLException e)
+ {
warn("config.15", new Object[] {id}, e);
continue;
}
- }
-
- signerCertsLocStr = (signerCertsLocURI != null) ? signerCertsLocURI.toString() : null;
-
- TrustProfile profile = null;
-
- if (tslEnabled) {
- // create new trust anchor location (=tslworking trust profile)
- File fTslWorkingDir = new File(tslWorkingDir);
- File tp = new File(fTslWorkingDir, "trustprofiles");
- if (!tp.exists())
- tp.mkdir();
- if (!tp.isDirectory()) {
- error("config.50", new Object[] { tp.getPath() });
- }
-
- File tpid = new File(tp, id);
- if (!tpid.exists())
- tpid.mkdir();
- if (!tpid.isDirectory()) {
- error("config.50", new Object[] { tpid.getPath() });
- }
-
-
- // create profile
- profile = new TrustProfile(id, tpid.getAbsolutePath(), signerCertsLocStr, tslEnabled, countries);
-
- // set original uri (save original trust anchor location)
- profile.setUriOrig(trustAnchorsLocURI.getPath());
-
- // delete files in tslworking trust profile
- File[] files = tpid.listFiles();
- for (File file : files)
- file.delete();
-
- // copy files from trustAnchorsLocURI into tslworking trust profile kopieren
- File src = new File(trustAnchorsLocURI.getPath());
- files = src.listFiles();
- for (File file : files) {
- FileUtils.copyFile(file, new File(tpid, file.getName()));
- }
-
-
- } else {
-
- profile = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr, tslEnabled, countries);
-
- }
-
- trustProfiles.put(id, profile);
-
- }
-
- return trustProfiles;
- }
-
- /**
- * Build the trust profile mapping.
- *
- * @return The profile ID to profile mapping.
- */
- public Map buildTrustProfiles()
- {
- Map trustProfiles = new HashMap();
- NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_PROFILE_XPATH);
- Element profileElem;
-
- while ((profileElem = (Element) profileIter.nextNode()) != null)
- {
- String id = getElementValue(profileElem, CONF + "Id", null);
- String trustAnchorsLocStr = getElementValue(profileElem, CONF + "TrustAnchorsLocation", null);
- String signerCertsLocStr = getElementValue(profileElem, CONF + "SignerCertsLocation", null);
-
- URI trustAnchorsLocURI = null;
- try
- {
- trustAnchorsLocURI = new URI(trustAnchorsLocStr);
- if (!trustAnchorsLocURI.isAbsolute()) { // make it absolute to the config file
- trustAnchorsLocURI = new URI(configRoot_.toURL() + trustAnchorsLocStr);
+ File profileDir = new File(trustAnchorsLocURI.getPath());
+ if (!profileDir.exists() || !profileDir.isDirectory()) {
+ warn("config.27", new Object[] { "uri", id });
+ continue;
}
- }
- catch (URIException e) {
- warn("config.14", new Object[] { "uri", id, trustAnchorsLocStr }, e);
- continue;
- }
- catch (MalformedURLException e)
- {
- warn("config.15", new Object[] {id}, e);
- continue;
- }
- File profileDir = new File(trustAnchorsLocURI.getPath());
- if (!profileDir.exists() || !profileDir.isDirectory()) {
- warn("config.27", new Object[] { "uri", id });
- continue;
- }
-
-
-
- if (trustProfiles.containsKey(id)) {
- warn("config.04", new Object[] { "TrustProfile", id });
- continue;
- }
-
- URI signerCertsLocURI = null;
- if (signerCertsLocStr != null && !"".equals(signerCertsLocStr))
- {
- try
+ //check signerCertsLocation URL
+ String signerCertsLocStr = getElementValue(profileElem, CONF + "SignerCertsLocation", null);
+ URI signerCertsLocURI = null;
+ if (signerCertsLocStr != null && !"".equals(signerCertsLocStr))
{
- signerCertsLocURI = new URI(signerCertsLocStr);
- if (!signerCertsLocURI.isAbsolute()) signerCertsLocURI = new URI(configRoot_.toURL() + signerCertsLocStr);
-
- File signerCertsDir = new File(signerCertsLocURI.getPath());
- if (!signerCertsDir.exists() || !signerCertsDir.isDirectory()) {
- warn("config.27", new Object[] { "signerCertsUri", id });
+ try
+ {
+ signerCertsLocURI = new URI(signerCertsLocStr);
+ if (!signerCertsLocURI.isAbsolute()) signerCertsLocURI = new URI(configRoot_.toURL() + signerCertsLocStr);
+
+ File signerCertsDir = new File(signerCertsLocURI.getPath());
+ if (!signerCertsDir.exists() || !signerCertsDir.isDirectory()) {
+ warn("config.27", new Object[] { "signerCertsUri", id });
+ continue;
+ }
+ }
+ catch (URIException e) {
+ warn("config.14", new Object[] { "signerCertsUri", id, trustAnchorsLocStr }, e);
continue;
}
- }
- catch (URIException e) {
- warn("config.14", new Object[] { "signerCertsUri", id, trustAnchorsLocStr }, e);
- continue;
- }
- catch (MalformedURLException e) {
- warn("config.15", new Object[] {id}, e);
- continue;
- }
- }
-
- signerCertsLocStr = (signerCertsLocURI != null) ? signerCertsLocURI.toString() : null;
-
- TrustProfile profile = null;
-
- profile = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr, false, null);
+ catch (MalformedURLException e) {
+ warn("config.15", new Object[] {id}, e);
+ continue;
+ }
+ }
+ signerCertsLocStr = (signerCertsLocURI != null) ? signerCertsLocURI.toString() : null;
+
+
+ //check if TSL support is enabled
+ Element eutslElem = (Element) XPathUtils.selectSingleNode(profileElem, CONF + "EUTSL");
+ boolean tslEnabled = false;
+ if (eutslElem != null) //EUTSL element found --> TSL enabled
+ tslEnabled = true;
+
+ //load TSL configuration
+ String countries = getElementValue(profileElem, CONF + "EUTSL" + "/" + CONF + "CountrySelection", null);
+ String allowedTspStatus = getElementValue(profileElem, CONF + "EUTSL" + "/" + CONF + "AllowedTSPStatus", null);
+ String allowedTspServiceTypes = getElementValue(profileElem, CONF + "EUTSL" + "/" + CONF + "AllowedTSPServiceTypes", null);
- trustProfiles.put(id, profile);
+
+ //create profile configuration
+ TrustProfile profile = new TrustProfile(id, trustAnchorsLocURI.toString(), signerCertsLocStr,
+ tslEnabled, countries, allowedTspStatus, allowedTspServiceTypes);
+ trustProfiles.put(id, profile);
}
return trustProfiles;
}
-
- /**
- * checks if a trustprofile with TSL support is enabled
- *
- * @return true if TSL support is enabled in at least one trustprofile, else false
- */
- public boolean checkTrustProfilesTSLenabled()
- {
- NodeIterator profileIter = XPathUtils.selectNodeIterator(getConfigElem(), TRUST_PROFILE_XPATH);
- Element profileElem;
-
- boolean tslSupportEnabled = false;
- while ((profileElem = (Element) profileIter.nextNode()) != null) {
- Element eutslElem = (Element) XPathUtils.selectSingleNode(profileElem, CONF + "EUTSL");
- if (eutslElem != null) //EUTSL element found --> TSL enabled
- tslSupportEnabled = true;
- }
-
- return tslSupportEnabled;
- }
-
+
/**
* Returns the location of the certificate store.
*
@@ -1805,6 +1674,44 @@ public class ConfigurationPartsBuilder {
debug("config.39", new Object[] { "WorkingDirectory", workingDirectoryStr });
}
+ String qcQualifier = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "Evaluation/" + CONF + "QCQualifier", null);
+ if (MiscUtil.isEmpty(qcQualifier))
+ info("config.39", new Object[] { "Evaluation/QCQualifier", " EMPTY" });
+
+ else {
+ String[] qcQualList = qcQualifier.split(",");
+ for (String el : qcQualList) {
+ try {
+ tslconfiguration.addQualifierForQC(new java.net.URI(el.trim()));
+ //info("config.39", new Object[] { "Evaluation/QCQualifier", el.trim() });
+
+ } catch (URISyntaxException e) {
+ warn("config.39", new Object[] { "Evaluation/QCQualifier", el.trim() }, e);
+
+ }
+
+ }
+ }
+
+ String sscdQualifier = getElementValue(getConfigElem(), TSL_CONFIGURATION_XPATH + CONF + "Evaluation/" + CONF + "SSCDQualifier", null);
+ if (MiscUtil.isEmpty(qcQualifier))
+ info("config.39", new Object[] { "Evaluation/SSCDQualifier", " EMPTY" });
+
+ else {
+ String[] sscdQualList = sscdQualifier.split(",");
+ for (String el : sscdQualList) {
+ try {
+ tslconfiguration.addQualifierForSSCD(new java.net.URI(el.trim()));
+ //info("config.39", new Object[] { "Evaluation/SSCDQualifier", el.trim() });
+
+ } catch (URISyntaxException e) {
+ warn("config.39", new Object[] { "Evaluation/SSCDQualifier", el.trim() }, e);
+
+ }
+
+ }
+ }
+
// convert update schedule starting time to Date object
Calendar Cal = DatatypeConverter.parseDateTime(updateScheduleStartTime);
Date updateScheduleStartTimeDate = Cal.getTime();
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
index d777d8f..79ef1d2 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
@@ -51,6 +51,7 @@ import at.gv.egovernment.moa.spss.util.MessageProvider;
import at.gv.egovernment.moaspss.logging.LogMsg;
import at.gv.egovernment.moaspss.logging.Logger;
import at.gv.egovernment.moaspss.util.DOMUtils;
+import at.gv.egovernment.moaspss.util.MiscUtil;
/**
* A class providing access to the MOA configuration data.
@@ -354,17 +355,17 @@ public class ConfigurationProvider
// build the internal datastructures
try {
builder = new ConfigurationPartsBuilder(configElem, configRoot);
+
+ //build TSL configuration
+ tslconfiguration_ = builder.getTSLConfiguration();
- if (builder.checkTrustProfilesTSLenabled()) {
- debug("TSL support enabled for at least one trustprofile.");
- tslconfiguration_ = builder.getTSLConfiguration();
- trustProfiles = builder.buildTrustProfiles(tslconfiguration_.getWorkingDirectory());
- }
- else {
- tslconfiguration_ = null;
- trustProfiles = builder.buildTrustProfiles();
- }
+ //build TrustProfile configuration
+ trustProfiles = builder.buildTrustProfiles();
+ //check TSL configuration
+ checkTSLConfiguration();
+
+
digestMethodAlgorithmName = builder.getDigestMethodAlgorithmName();
canonicalizationAlgorithmName =
builder.getCanonicalizationAlgorithmName();
@@ -401,13 +402,10 @@ public class ConfigurationProvider
revocationArchiveJDBCDriverClass_ = builder.getRevocationArchiveJDBCDriverClass();
-
- //check TSL configuration
- checkTSLConfiguration();
-
+ //TODO!!!!
+ certStoreLocation_ = builder.getCertStoreLocation();
- certStoreLocation_ = builder.getCertStoreLocation();
createTransformsInfoProfiles = builder.buildCreateTransformsInfoProfiles();
createSignatureEnvironmentProfiles = builder.buildCreateSignatureEnvironmentProfiles();
verifyTransformsInfoProfiles = builder.buildVerifyTransformsInfoProfiles();
@@ -451,19 +449,19 @@ public class ConfigurationProvider
}
}
- private boolean checkTSLenableTrustprofilesExist()throws ConfigurationException {
- boolean bTSLEnabledTPExist = false;
- Iterator it = trustProfiles.entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry pairs = (Map.Entry)it.next();
- TrustProfile tp = (TrustProfile) pairs.getValue();
- if (tp.isTSLEnabled())
- bTSLEnabledTPExist = bTSLEnabledTPExist || true;
- }
-
- return bTSLEnabledTPExist;
-
- }
+// private boolean checkTSLenableTrustprofilesExist()throws ConfigurationException {
+// boolean bTSLEnabledTPExist = false;
+// Iterator it = trustProfiles.entrySet().iterator();
+// while (it.hasNext()) {
+// Map.Entry pairs = (Map.Entry)it.next();
+// TrustProfile tp = (TrustProfile) pairs.getValue();
+// if (tp.isTSLEnabled())
+// bTSLEnabledTPExist = bTSLEnabledTPExist || true;
+// }
+//
+// return bTSLEnabledTPExist;
+//
+// }
private void checkTSLConfiguration() throws ConfigurationException {
boolean bTSLEnabledTPExist = false;
@@ -516,7 +514,7 @@ public class ConfigurationProvider
return;
}
- System.setProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR", hashcache.getAbsolutePath());
+// System.setProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR", hashcache.getAbsolutePath());
// String hashcachedir = System.getProperty("iaik.xml.crypto.tsl.BinaryHashCache.DIR");
// System.out.println("Hashcache: " + hashcachedir);
@@ -826,7 +824,14 @@ public class ConfigurationProvider
* <code>null</code>, if none exists.
*/
public TrustProfile getTrustProfile(String id) {
- return (TrustProfile) trustProfiles.get(id);
+
+ if (MiscUtil.isNotEmpty(id)) {
+ id = id.trim().toLowerCase();
+ return (TrustProfile) trustProfiles.get(id);
+
+ }
+
+ return null;
}
/**
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java
index 21063c7..f64643f 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/TrustProfile.java
@@ -24,6 +24,15 @@
package at.gv.egovernment.moa.spss.server.config;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import at.gv.egovernment.moa.sig.tsl.TslConstants;
+import at.gv.egovernment.moaspss.logging.Logger;
+import at.gv.egovernment.moaspss.util.MiscUtil;
import iaik.x509.X509Certificate;
/**
@@ -39,14 +48,15 @@ public class TrustProfile {
private String uri;
/** The URI giving the location of the allowed signer certificates. */
private String signerCertsUri;
+
/** Defines if Trustprofile makes use of EU TSL*/
private boolean tslEnabled;
- /** The original URI (out of the configuration) giving the location of the trust profile (used when TSL is enabled) */
- private String uriOrig;
/** The countries given */
- private String countries;
- /** */
- private X509Certificate[] certificatesToBeRemoved;
+ private List<String> countries = new ArrayList<String>();
+
+ private List<URI> allowedTspStatus = new ArrayList<URI>();
+ private List<URI> allowedTspServiceTypes = new ArrayList<URI>();
+
/**
* Create a <code>TrustProfile</code>.
@@ -55,16 +65,90 @@ public class TrustProfile {
* @param uri The URI of the <code>TrustProfile</code> to create.
* @param signerCertsUri The URI of the location of the allowed signer
* certificates of the <code>TrustProfile</code> to create.
+ * @param allowedTspServiceTypes
+ * @param allowedTspStatus
*/
- public TrustProfile(String id, String uri, String signerCertsUri, boolean tslEnabled, String countries) {
+ public TrustProfile(String id, String uri, String signerCertsUri,
+ boolean tslEnabled, String countries, String allowedTspStatus, String allowedTspServiceTypes) {
this.id = id;
this.uri = uri;
this.signerCertsUri = signerCertsUri;
+
+ //TSL configuration parameters
this.tslEnabled = tslEnabled;
- this.countries = countries;
- this.certificatesToBeRemoved = new X509Certificate[0];
+
+ setCountries(countries);
+ Logger.debug("TrustProfile "+ id + " allows " + Arrays.toString(this.countries.toArray()) + " TSL countries");
+
+ setAllowedTspStatus(allowedTspStatus);
+ Logger.debug("TrustProfile "+ id + " allows " + Arrays.toString(this.allowedTspStatus.toArray()) + " TSP status identifier");
+
+ setAllowedTspServiceTypes(allowedTspServiceTypes);
+ Logger.debug("TrustProfile "+ id + " allows " + Arrays.toString(this.allowedTspServiceTypes.toArray()) + " TSL service-type identifier");
+
}
+ private void setCountries(String countries) {
+ if (MiscUtil.isNotEmpty(countries)) {
+ String[] ccArray = countries.split(",");
+ for (String el : ccArray)
+ this.countries.add(el.trim());
+
+ }
+ }
+
+ private void setAllowedTspStatus(String allowedTspStatus) {
+ if (MiscUtil.isNotEmpty(allowedTspStatus)) {
+ String[] ccArray = allowedTspStatus.split(",");
+ for (String el : ccArray) {
+ try {
+ this.allowedTspStatus.add(new URI(el.trim()));
+
+ } catch (URISyntaxException e) {
+ Logger.warn("TrustProfile: " + this.id + " contains a non-valid TSP Status identifier (" + el + ")");
+
+ }
+
+ }
+
+ } else {
+ Logger.info("Use default set of TSP Status identifier");
+ this.allowedTspStatus.addAll(
+ Arrays.asList(
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_STATUS_SHORT.granted),
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_STATUS_SHORT.recognisedatnationallevel),
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_STATUS_SHORT.accredited),
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_STATUS_SHORT.undersupervision)));
+
+ }
+
+ }
+
+ private void setAllowedTspServiceTypes(String allowedTspServiceTypes) {
+ if (MiscUtil.isNotEmpty(allowedTspServiceTypes)) {
+ String[] ccArray = allowedTspServiceTypes.split(",");
+ for (String el : ccArray) {
+ try {
+ this.allowedTspStatus.add(new URI(el.trim()));
+
+ } catch (URISyntaxException e) {
+ Logger.warn("TrustProfile: " + this.id + " contains a non-valid TSP Service-Type identifier (" + el + ")");
+
+ }
+
+ }
+
+ } else {
+ Logger.info("Use default set of TSP Service-Type identifier");
+ this.allowedTspStatus.addAll(
+ Arrays.asList(
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_TYPE_SHORT.CA_QC),
+ TslConstants.SERVICE_STATUS_SORT_TO_URI.get(TslConstants.SERVICE_TYPE_SHORT.TSA_QTST)));
+
+ }
+
+ }
+
/**
* Return the ID of this <code>TrustProfile</code>.
*
@@ -83,14 +167,6 @@ public class TrustProfile {
return uri;
}
- /**
- * Return the original URI of this <code>TrustProfile</code>.
- *
- * @return The original URI of <code>TrustProfile</code>.
- */
- public String getUriOrig() {
- return uriOrig;
- }
/**
* Return the URI giving the location of the allowed signer certificates
@@ -112,21 +188,21 @@ public class TrustProfile {
* Returns the given countries
* @return Given countries
*/
- public String getCountries() {
+ public List<String> getCountries() {
if (!tslEnabled)
return null;
else
return countries;
}
-
-
- /**
- * Sets the original URI of this <code>TrustProfile</code>.
- *
- * @return The original URI of <code>TrustProfile</code>.
- */
- public void setUriOrig(String uriOrig) {
- this.uriOrig = uriOrig;
+
+ public List<URI> getAllowedTspStatus() {
+ return allowedTspStatus;
+ }
+
+ public List<URI> getAllowedTspServiceTypes() {
+ return allowedTspServiceTypes;
}
+
+
}