Community
Participate
Working Groups
I use ant to sign a jar file (JarSigner). Classes in this jar need to be checked with signers' info after loaded for security purpose. However, the Class.getSigners() always returns null in plugin runtime env where the classLoader is EclipseClassLoader; while it works fine in a standalone java application (test Application) with the same jar file--the ClassLoader is Launcher$AppClassLoader in this case. try { ClassLoader classLoader = LicenseProviderFactory.class.getClassLoader(); classLicenseProvider = classLoader.loadClass( LicenseProviderFactory.licenseProviderClass ); } catch ( Exception e ) { throw new LicenseException ( LicenseProviderFactory.licenseProviderClass + " not found.", e ); } // it is always null in plugin env. Object signers[] = classLicenseProvider.getSigners(); if ( signers == null ) { throw new LicenseException ( LicenseProviderFactory.licenseProviderClass + " has not been signed properly." ); } else { //verify signature }
Fixed with the new signed bundle support in the framework. You must set the following property in the config.ini to enable the support. osgi.support.signiture.verify=true
is it a typo in the bug or in the code, or both: osgi.support.signiture.verify ^^^^
both, thanks Pascal!! should be: osgi.support.signature.verify = true
*** Bug 110846 has been marked as a duplicate of this bug. ***