I have an Eclipse RCP application with some sensitive properties. The properties will be encrypted, based on a secret key entered by the user. Bundles / Plug-ins define properties, and whether or not they should be encrypted. The trick is this: The bundle that defines the property should be the only bundle that is allowed to then access that property decrypted (by default). I understand that normally each bundle should have it's own properties managed independently, but this isn't possible since the properties are retrieved from a centralized location.
I.e., how can I do this:
public byte[] getByteArrayProperty(Object id){
if (method is being called by code in bundle: bundleId)
return decrypt(property);
else
throw new SecurityException("Bundle " + bundleId + " not authorized to access property " + id);
}
Thanks for any and all suggestions!
./P