aboutsummaryrefslogtreecommitdiff
path: root/moaSig/moa-sig-lib/src
diff options
context:
space:
mode:
Diffstat (limited to 'moaSig/moa-sig-lib/src')
-rw-r--r--moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java38
1 files changed, 28 insertions, 10 deletions
diff --git a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
index 3472419..c9a76f4 100644
--- a/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
+++ b/moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/iaik/config/IaikConfigurator.java
@@ -44,6 +44,7 @@ import at.gv.egovernment.moa.spss.util.SecProviderUtils;
import at.gv.egovernment.moaspss.logging.LogMsg;
import at.gv.egovernment.moaspss.logging.Logger;
import iaik.logging.LogFactory;
+import iaik.pki.PKIException;
import iaik.pki.store.revocation.RevocationFactory;
import iaik.pki.store.revocation.RevocationSourceStore;
import iaik.pki.store.truststore.TrustStoreFactory;
@@ -52,6 +53,7 @@ import iaik.server.Configurator;
import iaik.server.modules.keys.KeyEntryID;
import iaik.server.modules.keys.KeyModule;
import iaik.server.modules.keys.KeyModuleFactory;
+import iaik.util.logging.Log;
/**
* A class responsible for configuring the IAIK MOA modules.
@@ -89,16 +91,11 @@ public class IaikConfigurator {
LogFactory.configure(configData.getLoggerConfig());
- try {
- iaik.pki.Configurator.initCommon(configData.getLoggerConfig(),
- transId);
- // SecProviderUtils.dumpSecProviders("initCommon");
- final String certStoreRoot = moaConfig.getCertStoreLocation();
- CertStoreConverter.convert(certStoreRoot, transId);
- } finally {
- // Security.removeProvider(ECCelerate.getInstance().getName());
- }
-
+
+ // initialize PKI commons
+ initializePkiCommons(moaConfig, transId, configData);
+
+ // initialze IAIK MOA
Configurator.init(configData, transId);
SecProviderUtils.dumpSecProviders("Fully configured!");
@@ -125,6 +122,27 @@ public class IaikConfigurator {
}
}
+ private static void initializePkiCommons(ConfigurationProvider moaConfig, TransactionId transId, ConfigurationData configData) throws PKIException {
+ if (!iaik.pki.Configurator.isInitialized()) {
+ logger.info("Initializing IAIK PKI-Commons ... ");
+ try {
+ iaik.pki.Configurator.initCommon(configData.getLoggerConfig(),
+ transId);
+
+ final String certStoreRoot = moaConfig.getCertStoreLocation();
+ CertStoreConverter.convert(certStoreRoot, transId);
+
+ } finally {
+ // Security.removeProvider(ECCelerate.getInstance().getName());
+ }
+
+ } else {
+ logger.debug("IAIK PKI-Commons already initialized");
+
+ }
+
+ }
+
private static void logException(Throwable e) {
final StringWriter out = new StringWriter();
final PrintWriter writer = new PrintWriter(out);