-
1. Re: JBoss 3.2 and BouncyCastle
jonlee May 9, 2003 8:32 PM (in response to alanmoor)Not quite sure what you are trying to do but here are some excerpts of our routines from an MBean:
try
{
X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(publicKeyBytes);
KeyFactory keyFactory = KeyFactory.getInstance("RSA", "BC");
publicKey = keyFactory.generatePublic(publicKeySpec);
}
catch(Exception e)
{
log.error("The public key is badly formatted.");
return false;
}
So we're using the Bouncy Castle RSA routines for generating the public key - all through the JCE API. The JBoss security policies are fine (java.policy) - we don't touch them.
bcprov-jdk14-118.jar lives in JAVA_HOME/jre/lib/ext.
In JAVA_HOME/jre/lib/security/java.security add the line,
security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider
And then the routine works. So we're not doing anything too special or different from the JCE guidelines.
We're just speculating on things here as you'd need to detail further your code for a clear understanding. -
2. Re: JBoss 3.2 and BouncyCastle
alanmoor May 10, 2003 8:27 AM (in response to alanmoor)Thank you for your response. Let me start by saying that I'm a fairly junior Java programmer (less than a year) and totally inexperiences with JCE, so I'm doing most of my coding by example and fighting my way through stack traces using Google searches and newsgroups. Painful at best.
I brought the code home last night and set everything up and it runs fine. Not sure what's up with the environment at work, but I'm sure I'll figure it out. Sorry to waste your time.