The Bouncy Castle Provider

Recently I was using a Java applet which generated a digital certificate for storage on the local file system, but which was failing, silently, at the last step.

Switching the browser’s security settings down to the lowest (i.e. least secure) level and, subsequently, starting the browser as an Administrator made no difference.

Bringing up the Java Console, I found a stack trace of exceptions with the following root:
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider

This indicated that the applet depended on one or more third-party libraries which had not been deployed with the applet. The solution, here, was to download the current implementation of the Bouncy Castle Cryptography library.

I copied the four .jar files (you don’t need to download the ‘Test Classes’) into the Optional Package directory of my Java installation.

(On Windows, Java is typically installed into the Java folder/directory under Program Files, or, if you are using 32-bit Java on 64-bit Windows, in the Java folder/directory under ‘Program Files (x86)’.)

After restarting the browser again, the applet functioned as desired.

Advertisements

2 Responses to “The Bouncy Castle Provider”


  1. 1 Peter March 1, 2016 at 11:27 pm

    So every user of your applet must download and install BC jars on client machine for this to work?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: