Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have developed an application in which I have used the Cryptography with the help of BountyCastle.jar. I also had a line Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());

Everything works fine when I execute the program from Netbeans

But when I packaging the application in an executable jar which internally uses BouncyCastle jar and execute the jar,

I am getting exception

JCE cannot authenticate the provider BC java.lang.SecurityException: JCE cannot authenticate the provider BC

Is there any other approch to implement the same. Because it is difficult for non technical person to add BountyCastle.jar in ext folder of jre. so is there any other method to solve my problem.

Is there any method to exclude BountyCastle.jar while packaging jar in netbeans so that will accessible from external lib folder.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
573 views
Welcome To Ask or Share your Answers For Others

1 Answer

The BouncyCastle jar archive is signed by BouncyCastle to prevent unauthorized changes. It needs the JCA signature in order to be trusted as a cryptography provider, so do not remove it.

See a related post


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...