Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JCE cannot authenticate the provider BC in java swing application

I am creating a swing based application in Java which uses some encryption technique. But javax.crypto.KeyGenerator.getInstance("AES", "BC") gives exception:

java.security.NoSuchProviderException: JCE cannot authenticate the provider BC         at javax.crypto.SunJCE_b.a(DashoA13*..)         at javax.crypto.KeyGenerator.getInstance(DashoA13*..) 

So what is the problem?

like image 435
user1041858 Avatar asked Dec 05 '12 10:12

user1041858


1 Answers

  1. edit jre\lib\security\java.security
  2. add security.provider.10=org.bouncycastle.jce.provider.BouncyCastleProvider
  3. copy bc*.jar to jre\lib\ext
like image 160
jiangzx Avatar answered Oct 14 '22 00:10

jiangzx