|
Re: Custom TrustEngine with Equinox servlet bridge [message #1014506 is a reply to message #1014443] |
Tue, 26 February 2013 00:13 |
Michael Yara Messages: 27 Registered: July 2009 |
Junior Member |
|
|
I was able to answer my own question with some research and trial and error.
Here is the solution:
First you want to implement a Framework adapter hook. I followed the Hello Adaptor Hook example in the following pdf
http://www.eclipsecon.org/2008/sub/attachments/Equinox_Framework_How_to_get_Hooked.pdf
In the adaptor package that you created add your implementation of TrustEngine. Mine was called BundleTrustEngine.
Next fill out the frameworkStart() method in your AdaptorHook class with the following in order to register your TrustEngine:
Hashtable<String, Object> properties = new Hashtable<String, Object>();
properties.put(Constants.SERVICE_RANKING, new Integer(Integer.MAX_VALUE));
properties.put(SignedContentConstants.TRUST_ENGINE, "BundleTrustEngine");
context.registerService(TrustEngine.class.getName(), new BundleTrustEngine(), properties);
Replace "BundleTrustEngine" with the name of your TrustEngine implementation class.
Next set the following as runtime properties of the application using -D or specify them in your config.ini file.
osgi.framework.extensions=com.xmlnamespace.equinox.hook
osgi.signedcontent.support=all
osgi.signedcontent.authorization.engine.policy=trusted
osgi.signedcontent.trust.engine=BundleTrustEngine
The osgi.framework.extensions should be set to the name of the bundle that houses your Adaptor hook.
You may also want to look at the following articles on how to properly deploy your adaptor hook:
http://wiki.eclipse.org/Adaptor_Hooks
I have not got to the part where I have included this in my embedded application but I am guessing that you simply have to export your adaptor hook bundle fragment jar and included it in the WebContent/WEB-INF/eclipse/plugins directory of the equinox servlet bridge war and repackage the war file.
[Updated on: Tue, 26 February 2013 00:16] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03319 seconds