Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 115719 - Class loaded by EclipseClassLoader lost getSigners() info
Summary: Class loaded by EclipseClassLoader lost getSigners() info
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.2 M6   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 110846 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-11-09 17:55 EST by Richard Xu CLA
Modified: 2006-03-22 18:37 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Xu CLA 2005-11-09 17:55:14 EST
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
}
Comment 1 Thomas Watson CLA 2006-03-06 14:50:03 EST
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
Comment 2 Pascal Rapicault CLA 2006-03-06 15:08:40 EST
is it a typo in the bug or in the code, or both:
  osgi.support.signiture.verify
                  ^^^^

Comment 3 Thomas Watson CLA 2006-03-06 15:20:36 EST
both, thanks Pascal!! should be:

osgi.support.signature.verify = true
Comment 4 Thomas Watson CLA 2006-03-22 18:37:11 EST
*** Bug 110846 has been marked as a duplicate of this bug. ***