From 66414f0eb9f2bc5a0bce27b3cf2b1e897aca35eb Mon Sep 17 00:00:00 2001 From: Max Lambrecht Date: Tue, 4 Sep 2018 12:06:04 -0300 Subject: [PATCH] Removing BouncyCastle dependency and using JCE standard library Signed-off-by: Max Lambrecht --- build.gradle | 3 --- src/main/java/spiffe/provider/CertificateUtils.java | 5 +---- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index d227c8f..c14e4bb 100644 --- a/build.gradle +++ b/build.gradle @@ -68,8 +68,5 @@ dependencies { compile "io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64" compile "io.netty:netty-transport-native-kqueue:${nettyVersion}:osx-x86_64" compile "org.apache.commons:commons-lang3:3.7" - - compile "org.bouncycastle:bcprov-jdk15on:1.59" - compile "org.bouncycastle:bcpkix-jdk15on:1.59" } diff --git a/src/main/java/spiffe/provider/CertificateUtils.java b/src/main/java/spiffe/provider/CertificateUtils.java index 2f6848e..4aae882 100644 --- a/src/main/java/spiffe/provider/CertificateUtils.java +++ b/src/main/java/spiffe/provider/CertificateUtils.java @@ -1,8 +1,5 @@ package spiffe.provider; -import org.apache.commons.lang3.StringUtils; -import org.bouncycastle.jce.provider.BouncyCastleProvider; - import java.io.ByteArrayInputStream; import java.security.*; import java.security.cert.*; @@ -68,7 +65,7 @@ class CertificateUtils { * @throws InvalidKeySpecException */ static PrivateKey generatePrivateKey(byte[] input) throws NoSuchAlgorithmException, InvalidKeySpecException { - KeyFactory keyFactory = KeyFactory.getInstance(PRIVATE_KEY_ALGORITHM, new BouncyCastleProvider()); + KeyFactory keyFactory = KeyFactory.getInstance(PRIVATE_KEY_ALGORITHM); return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(input)); }