summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java
diff options
context:
space:
mode:
authormcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-11 14:42:17 +0000
committermcentner <mcentner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4>2008-12-11 14:42:17 +0000
commit401c481eed1f1e30928f7310d35832f8411d7e1b (patch)
tree06e34c4caba97cdec004691f589919b12ab45b3b /bkucommon/src/main/java
parent34f9096244278da49ffcf9313fe6ed0d03fd8386 (diff)
downloadmocca-401c481eed1f1e30928f7310d35832f8411d7e1b.tar.gz
mocca-401c481eed1f1e30928f7310d35832f8411d7e1b.tar.bz2
mocca-401c481eed1f1e30928f7310d35832f8411d7e1b.zip
XSecProvider delegation provider registration.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@246 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/main/java')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java b/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java
index e37d107f..733b47dc 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java
@@ -14,6 +14,7 @@ import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.Provider;
import java.security.Security;
+import java.security.Provider.Service;
import java.security.cert.CertStore;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
@@ -24,6 +25,7 @@ import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Properties;
+import java.util.Set;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
@@ -150,9 +152,21 @@ public abstract class Configurator {
log.debug("Registering security providers");
Security.insertProviderAt(new IAIK(), 1);
Security.insertProviderAt(new ECCProvider(false), 2);
- Security.addProvider(new STALProvider());
- XSecProvider.addAsProvider(false);
+
+ // registering STALProvider as delegation provider for XSECT
+ STALProvider stalProvider = new STALProvider();
+ Set<Service> services = stalProvider.getServices();
StringBuilder sb = new StringBuilder();
+ for (Service service : services) {
+ String algorithm = service.getType() + "." + service.getAlgorithm();
+ XSecProvider.setDelegationProvider(algorithm, stalProvider.getName());
+ sb.append("\n" + algorithm);
+ }
+ log.debug("Registered STALProvider as XSecProvider delegation provider for the following services : " + sb.toString());
+
+ Security.addProvider(stalProvider);
+ XSecProvider.addAsProvider(false);
+ sb = new StringBuilder();
sb.append("Registered providers: ");
int i = 1;
for (Provider prov : Security.getProviders()) {