Search code examples
javajarbouncycastleequinox

Installing signed jar in equinox


I am trying to install a feature into equinox OSGi container. I do this via the p2 director command line tool:

java -jar ./plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar -application org.eclipse.equinox.p2.director -no
splash -consoleLog -debug  -repository <repositoryUrl> -installIU <featurename> -profile <profileName> -vmargs -Declipse.p2.unsignedPolicy=allow

The installation however fails with the following error message:

!MESSAGE One or more certificates rejected. Cannot proceed with installation.

This is probably because the feature contains jars from bouncycastle that are signed and the certificate used to sign these jars is rejected.

Does anybody have an idea how I can solve this issue?

When I install the feature via the the GUI installation tool, I have no problem but during the installation I get a popup asking if I want to trust the certificate chain or not. The feature installs correctly if I click yes in this dialog box.

kr,

Frederik.


Solution

  • This seems to be a bug/missing feature in p2 Director. The workaround is to install the certificate into your JVM. You can extract the raw certificate from the signed JAR file.

    (you can find more info on how to extract the certificate in this post.)