1 Reply Latest reply on Feb 11, 2004 11:26 AM by starksm64

    Integration of JCE Service Providers // XML Security (Encryp

    nils

       

      "Nils" wrote:
      Hello,

      I need to use anonther Java Cryptography Service provider than the ones integrated in SUN's JRE - and so in JBoss (f.e. Bouncycastle, IAIK etc.). Could someone help me how I can integrate them to JBoss ? Using them in Java directly, it is enough to set the classpath for the jar's needed and make an entry in the java.security file (<JAVA>\jre\lib\security\java.security).

      Thank you very much in advance for your help. If someone is interested in changing experience with XML Security technologies, please let me know.

      Kind regards
      Nils


        • 1. Re: Integration of JCE Service Providers // XML Security (En
          starksm64

          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