Skip to content

Spongy Castle - a repackage of Bouncy Castle for Android (which ships a crippled version of BC)

License

Notifications You must be signed in to change notification settings

senecaso/spongycastle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spongy Castle - a repackage of Bouncy Castle for Android

This project aims to be a full replacement for the crippled versions of the Bouncy Castle cryptographic libraries which ship with Android. As noted here:

http://code.google.com/p/android/issues/detail?id=3280

...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.

Spongy Castle is the stock Bouncy Castle libraries with a couple of small changes to make it work on Android:

  • all package names have been moved from org.bouncycastle.* to org.spongycastle.* - so no classloader conflicts
  • the Java Security API Provider name is now SC rather than BC

No class names have been changed, so the BouncyCastleProvider class remains Bouncy, not Spongy, but moves to the org.spongycastle.jce.provider package.

Downloads

You can directly download the latest jar here (this is just a link to the published artifact in Maven Central).

Using Spongy Castle

You register it just the same as the standard BouncyCastleProvider:

static {
	Security.addProvider(new org.spongycastle.jce.provider.BouncyCastleProvider());
}

You can see an example of Spongy Castle in active use in the toy-android-ssh-agent project:

https://github.com/rtyley/toy-android-ssh-agent/blob/d768a9ba853272d396f3b528eb991ea38244e6bc/src/main/java/com/madgag/ssh/toysshagent/ToyAuthAgentService.java#L28

There's also an even simpler demo project showing how to include Spongy Castle in a vanilla Eclipse project:

https://github.com/rtyley/spongycastle-eclipse#readme

Maven

Spongy Castle artifacts have been published to Maven Central, you can use scprov-jdk15 as a drop-in replacement for the official Bouncy Castle artifact bcprov-jdk15.

I suggest you use the maven-android-plugin to make the most of this :-)

Licence

Bouncy Castle uses an adaptation of the MIT X11 License and as Spongy Castle is a simple re-package of Bouncy Castle, you should consider it to be licenced under those same terms.

Projects using Spongy Castle

JMRTD for Android

Gorilla for Android

About

Spongy Castle - a repackage of Bouncy Castle for Android (which ships a crippled version of BC)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.7%
  • Shell 0.3%