Skip to content

Commit

Permalink
Check if BouncyCastle provider is set
Browse files Browse the repository at this point in the history
  • Loading branch information
torrescd committed Oct 7, 2019
1 parent 580d700 commit 32ff65b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ private static PrivateKey handleECKey(InputStream keyInputStream) throws IOExcep
@Override
public PrivateKey call() {
try {
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
if (Security.getProvider("BC") == null) {
Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
}
PEMKeyPair keys = (PEMKeyPair) new PEMParser(new InputStreamReader(keyInputStream)).readObject();
return new
JcaPEMKeyConverter().
Expand Down

0 comments on commit 32ff65b

Please sign in to comment.