diff --git a/sigstore-java/src/main/java/dev/sigstore/encryption/Keys.java b/sigstore-java/src/main/java/dev/sigstore/encryption/Keys.java index ff31dbb0..e166408c 100644 --- a/sigstore-java/src/main/java/dev/sigstore/encryption/Keys.java +++ b/sigstore-java/src/main/java/dev/sigstore/encryption/Keys.java @@ -46,23 +46,7 @@ public class Keys { private static final Logger log = Logger.getLogger(Keys.class.getName()); static { - // Added for EdDSA support for Java <15 - - // This should work as JDK version strings are of the form '1.x.x' up to Java 8, and '9.x..' - // afterwards. - if (getJavaVersion() < 15) { - try { - log.info( - "Adding BouncyCastleProvider to SecurityManager for EdDSA algorithm support on Java <15."); - Security.addProvider(new BouncyCastleProvider()); - } catch (SecurityException e) { - log.warning( - "Could not configure BouncyCastleProvider due to SecurityManager restrictions." - + " EdDSA algorithms will not be supported. Refer to " - + "https://docs.oracle.com/cd/E19830-01/819-4712/ablsc/index.html to configure BouncyCastle " - + "for your JVM"); - } - } + Security.addProvider(new BouncyCastleProvider()); } /** diff --git a/sigstore-java/src/test/java/dev/sigstore/encryption/KeysTest.java b/sigstore-java/src/test/java/dev/sigstore/encryption/KeysTest.java index 16026de0..71074132 100644 --- a/sigstore-java/src/test/java/dev/sigstore/encryption/KeysTest.java +++ b/sigstore-java/src/test/java/dev/sigstore/encryption/KeysTest.java @@ -39,7 +39,7 @@ class KeysTest { void parsePublicKey_rsa() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { PublicKey result = Keys.parsePublicKey(Resources.toByteArray(Resources.getResource(RSA_PUB_PATH))); - assertEquals(result.getAlgorithm(), "RSA"); + assertEquals("RSA", result.getAlgorithm()); } @Test @@ -47,14 +47,14 @@ void parsePublicKey_rsaPkcs1() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { PublicKey result = Keys.parsePublicKey(Resources.toByteArray(Resources.getResource(RSA_PUB_PKCS1_PATH))); - assertEquals(result.getAlgorithm(), "RSA"); + assertEquals("RSA", result.getAlgorithm()); } @Test void parsePublicKey_ec() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { PublicKey result = Keys.parsePublicKey(Resources.toByteArray(Resources.getResource(EC_PUB_PATH))); - assertEquals(result.getAlgorithm(), "EC"); + assertEquals("EC", result.getAlgorithm()); } @Test @@ -64,7 +64,7 @@ void parsePublicKey_ed25519_withBouncyCastle() PublicKey result = Keys.parsePublicKey(Resources.toByteArray(Resources.getResource(ED25519_PUB_PATH))); // BouncyCastle names the algorithm differently than the JDK - assertEquals(result.getAlgorithm(), "Ed25519"); + assertEquals("Ed25519", result.getAlgorithm()); } @Test @@ -73,7 +73,7 @@ void parsePublicKey_ed25519_withStdLib() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { PublicKey result = Keys.parsePublicKey(Resources.toByteArray(Resources.getResource(ED25519_PUB_PATH))); - assertEquals(result.getAlgorithm(), "EdDSA"); + assertEquals("EdDSA", result.getAlgorithm()); } @Test