Have you ever met this Exception like "Cryptography - JCE cannot authenticate provider BC"? and by now you don't know how to deal with it? If you all say "yes", Congratulations! Your have came the right place.
Follow me, i will give you the answer and tell you why should do like this.
You can download this lib form , type and version should choose by your current case, here i will choose java and which lastest java releases -- .
Copy this lib to your JRE/JDK base lib directory, for example
C:\Program Files\Java\jre1.6.0_07\lib\ext
/usr/local/jre1.6.0_14/lib/ext
If you need, you can deploy them to JDK's dir, just as you wish.
3.Set JCE Security Provider Open "java.security" and set the BC provider.
C:\Program Files\Java\jre1.6.0_07\lib\security
/usr/local/jre1.6.0_14/lib/security
security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider
Now, That all of BC part.
As to Java, if you want to use Long key, now you should get the support be JCE, version should fit to your JDK/JRE. More see my another aritcle " "
本文转自danni505 51CTO博客,原文链接:http://blog.51cto.com/danni505/175688,如需转载请自行联系原作者