Reputation: 21
I'm new to Bouncy Castle and have installed it using these instructions:
Both links describe the steps to
Step 1. Download the Bouncy Castle provider
Step 2. Copy the provider .jar file to the Java Runtime (JRE) extensions subfolder
Step 3. Add the Bouncy Castle provider to the java.security file
As per the first set of instructions, I can run this code and it correctly gives me the "is available" response:
import java.security.Security;
public class Main {
public static void main(String[] args) {
//BC is the ID for the Bouncy Castle provider;
if (Security.getProvider("BC") == null){
System.out.println("Bouncy Castle provider is NOT available");
}
else{
System.out.println("Bouncy Castle provider is available");
}
}
}
The problem is that once I add anything else to the code, like for example this line:
KeyGenerator keygen = KeyGenerator.getInstance("DES/ECB/PKCS5Padding");
or even this line
KeyGenerator keygen;
it then crashes. In the debug mode, it gives me a "Source not found." error with the button to "Edit Source Lookup Path...". The tab that contains the error message says "CEStreamExhausted(Throwable).() line 249".
Can anybody tell me what I'm doing wrong? This problem has been driving me crazy for days!
Upvotes: 0
Views: 2755
Reputation: 21
I no longer need this question answered. When I wrote this post, I had only followed the directions for the lastest version of Java that I had installed (both JRE and JDK 7). Since then, I decided just to try also following the directions for JRE 6, which I had installed but wasn't using. I also made sure to reboot my laptop. It works now. Sometimes it's the simple things... sigh
Upvotes: 0