I recently did some work at a client who were using a 3rd party provided java library in order to encrypt and decrypt data. This library had a specific algorithm, and would also use System.LoadLibrary() in order to load the jar. Their chosen platform was Jboss Fuse, the karaf flavour.
The client also had some bundles which were trying to use packages contained within the 3rd party java library. In order to use this library correctly, we needed to ensure the provider was installed in the JRE folder $JAVA_HOME/jre/lib/ext and that the security policy configuration was modified at $JAVA_HOME/jre/lib/security/java.security. Also, the bootdelegation needed to changed. In order to find out which packages we needed to add to boot delegation, we initially installed the jar, and inspected the osgi headers.
We can now see that the following packages would need to be added to the etc/config.properties for org.osgi.framework.bootdelegation
The above will make those security java packages available to all the bundles inside the karaf container. Therefore, no bundles should explicitly import them, since they are available in the container. Therefore in some instances we needed to explictly state that the bundles should not import those packages. The maven-bundle-pluginImport-Package configuration instruction can be used to explicitly ignore these packages. Example as below: