Skip to content

Commit da7d045

Browse files
authored
Merge pull request #125 from preuss-adam/apreuss/do-not-recrease-bc-provider
Do not recreate the bouncycastle provider every time
2 parents b3631cc + 87b8d4b commit da7d045

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/main/java/org/eclipse/biscuit/crypto/SECP256R1KeyPair.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ final class SECP256R1KeyPair extends KeyPair {
6969
}
7070

7171
static Signature getSignature() throws NoSuchAlgorithmException {
72-
return Signature.getInstance("SHA256withECDSA", new BouncyCastleProvider());
72+
return Signature.getInstance(
73+
"SHA256withECDSA", Security.getProvider(BouncyCastleProvider.PROVIDER_NAME));
7374
}
7475

7576
@Override

src/test/java/org/eclipse/biscuit/crypto/SignatureTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,15 @@
1414
import java.security.InvalidKeyException;
1515
import java.security.NoSuchAlgorithmException;
1616
import java.security.SecureRandom;
17-
import java.security.Security;
1817
import java.security.SignatureException;
1918
import org.eclipse.biscuit.error.Error;
2019
import org.eclipse.biscuit.token.Biscuit;
21-
import org.bouncycastle.jce.provider.BouncyCastleProvider;
2220
import org.junit.jupiter.api.Test;
2321

2422
/**
2523
* @serial exclude
2624
*/
2725
public class SignatureTest {
28-
29-
static {
30-
Security.addProvider(new BouncyCastleProvider());
31-
}
32-
3326
@Test
3427
public void testSerialize() {
3528
prTestSerialize(Schema.PublicKey.Algorithm.Ed25519, 32);

0 commit comments

Comments
 (0)