trekhaa.blogg.se

Java package bouncy castle
Java package bouncy castle









java package bouncy castle

If you apply this to an OSGi context, it means you cannot deploy Bouncycastle as a bundle whenever you want. And then, these providers must be loaded at startup. But if you wrap it into another JAR, you will lose the signature. And it seems not any certificate can be used (it must be approved by the JVM vendors). The explanation is that JCE (Java Cryptography Extension) providers are loaded in a special way by the JVM.

java package bouncy castle

For some reason, Bouncycastle was not loaded by the JVM. So, there was no error with compilation levels or in my code. And everything was working outside of OSGi. Looking at the logs of SSHj, no provider was found while the right classes were in the bundle’s class path. Unfortunately, later at runtime, another error came out. I solved it by using the Maven ANT plugin, removing signature files from my jar and repackaging it. Indeed, some files in the JAR were signed, and some others were not. Invalid signature file digest for Manifest main attributes The first attempt to build my all-in-one bundle resulted in a signature error during the Maven build. In an OSGi context, you can simply use the Maven Bundle plug-in, with the embedded-dependency directive.Īnyway, the difficulty here came because SSHj uses Bouncycastle as a security provider. In a classic context, you would use the Maven Shade plug-in. I had decided to wrap this library and its dependencies in my own bundle (something equivalent to an uber-jar but compliant with OSGi). I have recently tried to use SSHj in an OSGi bundle.











Java package bouncy castle