This content has been marked as final.
Show 1 reply
-
1. Re: Integration of JCE Service Providers // XML Security (En
starksm64 Feb 11, 2004 11:26 AM (in response to nils)The following MBean works for me:
package test; public interface BouncyCastleMBean { public void start() throws Exception; public void stop() throws Exception; } package test; import java.security.Security; import javax.crypto.Cipher; import org.bouncycastle.jce.provider.BouncyCastleProvider; public class BouncyCastle implements BouncyCastleMBean { public void start() throws Exception { BouncyCastleProvider bcp = new BouncyCastleProvider(); Security.addProvider(bcp); Cipher c = Cipher.getInstance("RSA", "BC"); System.out.println("Created RSA cipher: "+c+", provider:"+c.getProvider()); } public void stop() throws Exception { BouncyCastleProvider bcp = new BouncyCastleProvider(); Security.removeProvider(bcp.getName()); } }
The contents of the sar are:[starksm@banshee crypto-121]$ jar -tf output/bouncycastle.sar META-INF/MANIFEST.MF META-INF/jboss-service.xml test/BouncyCastle.class test/BouncyCastleMBean.class bcprov-jdk14-121.jar