Can I use latest BouncyCastle provider on Android?

2019-01-26 14:16发布

I am writing the app for Android 1.6.
Can anyone tell me if it is possible to use latest Bouncy Castle provider (version 1.46) instead of old one contained in SDK?
If so, correct instructions will be appreciated.

2条回答
该账号已被封号
2楼-- · 2019-01-26 15:05

Found the issue on google and SpongyCastle. After I added jar and called addProvider(), the app became bigger but could use BC 1.46 features like "Whirlpool" digest.

...the Android platform unfortunately incorporates a cut-down version of Bouncy Castle, which also makes installing an updated version of the libraries difficult due to classloader conflicts.

If you really need the full version of the Bouncy Castle libraries in your Android app, you may find it convenient to use Spongy Castle - a repackage of Bouncy Castle for Android:

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-01-26 15:06

You should be able to at least use the lightweight crypto library. Look for the lcrypto-jdk* on the releases page. I confess I don't have a android test environment available to verify any of this. Note that this version of the library does not use the JCE API.

查看更多
登录 后发表回答