From ccdffe119df6380878625267810f5e9efe709de9 Mon Sep 17 00:00:00 2001 From: Thomas Lenz Date: Tue, 13 May 2014 13:59:50 +0200 Subject: Remove bouncycastle provider --- id/server/stork2-saml-engine/pom.xml | 6 ++++ .../stork/peps/auth/engine/core/impl/SignP12.java | 35 ++++++++++----------- .../stork/peps/auth/engine/core/impl/SignSW.java | 36 +++++++++++----------- 3 files changed, 41 insertions(+), 36 deletions(-) (limited to 'id/server') diff --git a/id/server/stork2-saml-engine/pom.xml b/id/server/stork2-saml-engine/pom.xml index 8e249bb1a..b9620a782 100644 --- a/id/server/stork2-saml-engine/pom.xml +++ b/id/server/stork2-saml-engine/pom.xml @@ -49,6 +49,12 @@ eu.stork Commons ${commons.version} + + + org.bouncycastle + bcprov-jdk16 + + diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java index 6d9ac9ce3..06e80dc14 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignP12.java @@ -41,7 +41,6 @@ import eu.stork.peps.auth.engine.X509PrincipalUtil; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.NotImplementedException; import org.bouncycastle.jce.X509Principal; -import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.opensaml.Configuration; import org.opensaml.common.SAMLObject; import org.opensaml.common.SignableSAMLObject; @@ -518,23 +517,23 @@ public final class SignP12 implements SAMLEngineSignI { FileInputStream fisTrustStore = null; try { - // Dynamically register Bouncy Castle provider. - boolean found = false; - // Check if BouncyCastle is already registered as a provider - final Provider[] providers = Security.getProviders(); - for (int i = 0; i < providers.length; i++) { - if (providers[i].getName().equals( - BouncyCastleProvider.PROVIDER_NAME)) { - found = true; - } - } - - // Register only if the provider has not been previously registered - if (!found) { - LOG.debug("SAMLCore: Register Bouncy Castle provider."); - Security.insertProviderAt(new BouncyCastleProvider(), Security - .getProviders().length); - } +// // Dynamically register Bouncy Castle provider. +// boolean found = false; +// // Check if BouncyCastle is already registered as a provider +// final Provider[] providers = Security.getProviders(); +// for (int i = 0; i < providers.length; i++) { +// if (providers[i].getName().equals( +// BouncyCastleProvider.PROVIDER_NAME)) { +// found = true; +// } +// } +// +// // Register only if the provider has not been previously registered +// if (!found) { +// LOG.debug("SAMLCore: Register Bouncy Castle provider."); +// Security.insertProviderAt(new BouncyCastleProvider(), Security +// .getProviders().length); +// } p12Store = KeyStore.getInstance(properties .getProperty("keystoreType")); diff --git a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java index e31688069..39be750cd 100644 --- a/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java +++ b/id/server/stork2-saml-engine/src/main/java/eu/stork/peps/auth/engine/core/impl/SignSW.java @@ -22,7 +22,7 @@ import eu.stork.peps.exceptions.SAMLEngineException; import org.apache.commons.io.IOUtils; import org.apache.commons.lang.NotImplementedException; import org.bouncycastle.jce.X509Principal; -import org.bouncycastle.jce.provider.BouncyCastleProvider; +//import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.opensaml.Configuration; import org.opensaml.common.SAMLObject; import org.opensaml.common.SignableSAMLObject; @@ -488,23 +488,23 @@ public class SignSW implements SAMLEngineSignI { LOG.info("Load Cryptographic Service Provider"); FileInputStream fis = null; try { - // Dynamically register Bouncy Castle provider. - boolean found = false; - // Check if BouncyCastle is already registered as a provider - final Provider[] providers = Security.getProviders(); - for (int i = 0; i < providers.length; i++) { - if (providers[i].getName().equals( - BouncyCastleProvider.PROVIDER_NAME)) { - found = true; - } - } - - // Register only if the provider has not been previously registered - if (!found) { - LOG.info("SAMLCore: Register Bouncy Castle provider."); - Security.insertProviderAt(new BouncyCastleProvider(), Security - .getProviders().length); - } +// // Dynamically register Bouncy Castle provider. +// boolean found = false; +// // Check if BouncyCastle is already registered as a provider +// final Provider[] providers = Security.getProviders(); +// for (int i = 0; i < providers.length; i++) { +// if (providers[i].getName().equals( +// BouncyCastleProvider.PROVIDER_NAME)) { +// found = true; +// } +// } +// +// // Register only if the provider has not been previously registered +// if (!found) { +// LOG.info("SAMLCore: Register Bouncy Castle provider."); +// Security.insertProviderAt(new BouncyCastleProvider(), Security +// .getProviders().length); +// } storkOwnKeyStore = KeyStore.getInstance(properties .getProperty(KEYSTORE_TYPE)); -- cgit v1.2.3