|[equinox-dev] Bug when defining AdminPermissions for signed bundles using PermissionAdmin?!|
|While writing some example code that uses AdminPermission to setup certain permissions for bundles that have been signed by a specific certificate, I think I've run into a bug in Equinox, so I've filed it as https://bugs.eclipse.org/bugs/show_bug.cgi?id=217818|
I'm creating a bundle after an example found in the OSGi core R4.1 specification on page 101-278 (4.8.1 Admin Permission). The example shows how to restrict AdminPermission to bundles of a signer that has a subject name of ACME.
After defining this permission, I then run code from a bundle that needs this permission, and I get a ClassCastException at the point where this permission is (probably) being checked. The partial stack trace is printed below:
this occurs when the security check is invoked when calling getHeaders() on a bundle. This is line 32:
Dictionary headers = b.getHeaders();
To be honest, I'm kind of puzzled by this because this seems to be quite a basic example, so I might be overlooking something simple here?