|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.dvb.application.plugins.ApplicationSecurityContext
This class represents the security context for an application whose permissions are defined by the MHP security model, in particular a permission request file. One example of this is DVB-HTML applications managed by a plug-in application. This would also apply to applications in other content format where the permissions for that content format are signalled with MHP mechanisms and governed by the MHP security model.
| Constructor Summary | |
ApplicationSecurityContext(java.net.URL[] path,
java.net.URL entryPoint,
org.dvb.application.AppID appID)
Creates a new security context for an application whose code can be found on the path supplied, and whose entry point directory is as given. |
|
| Method Summary | |
void |
checkPermission(java.security.Permission p)
Throws a SecurityException if the requested
access, specified by the given permission, is not permitted
to the appliction or sub-application represented by this
application security context object. |
ApplicationSecurityContext |
createEmbeddedContext(java.net.URL[] path,
javax.tv.locator.Locator entryPoint)
Creates a context for an embedded part of an application, e.g. |
java.lang.Object |
doPrivileged(java.security.PrivilegedAction action)
Performs the specified PrivilegedAction with privileges enabled and restricted by the specified AccessControlContext. |
java.lang.ClassLoader |
getClassLoader(java.lang.String[] forbiddenPackages)
Get a classloader that is approprate for loading classes for the application (or sub-application) represented by this application security context object. |
java.net.URL |
getResource(java.lang.String name,
boolean sameSigner)
Get a locator to the named resource, within the search path for this application. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ApplicationSecurityContext(java.net.URL[] path,
java.net.URL entryPoint,
org.dvb.application.AppID appID)
throws java.io.IOException
If there is a permisison request file in the directory identified by the entryPoint, it will be processed in the same way as the permission request file of a DVB-J application. i.e. reading it in, parsing it and taking account of the access rights granted by the user as defined under "General principles" in the main body of this specification.
path - The search path for locating resources within the application.entryPoint - The directory containing the permission request file to useappID - the application ID which the application is to run underIOException - when there is an IO error reading in the permission
request file or attempting to read in the permission request file or
attempting to discover the existence of a permission request file.NullPointerException - if entryPoint is null, if path is null,
or if any element of path is null.java.lang.IllegalArgumentException - if path.length < 1| Method Detail |
public java.net.URL getResource(java.lang.String name,
boolean sameSigner)
Note (informative): This method can be used, for example, by an interoperable plug-in that needs to fetch part of an application that is not loaded by a classloader. For example, it could be used to get a locator to an HTML page, if and only if that page is appropriately signed.
name - The name of the resource (e.g. com/foo/MyPage.html)sameSigner - True if this is code, or any other resource for
which the signer must be the same as the signer
of the entry point.
public ApplicationSecurityContext createEmbeddedContext(java.net.URL[] path,
javax.tv.locator.Locator entryPoint)
path - The search path for locating resources within the application.entryPoint - The resource of the entry point of this application.NullPointerException - if entryPoint is null, if path is null,
or if any element of path is null.java.lang.IllegalArgumentException - if path.length < 1public java.lang.ClassLoader getClassLoader(java.lang.String[] forbiddenPackages)
It is important that embedded DVB-J code be prevented from accessing classes that implement the plug-in applicaiton. To this end, the plug-in may specify a list of forbidden packages. Classes loaded by the returned classloader will be forbidden from loading or accessing classes in the named packages.
forbiddenPackages - a list of forbidden package names, e.g.
{ "de.tu-bs.ing.ifn.plugin.impl" }.public void checkPermission(java.security.Permission p)
SecurityException if the requested
access, specified by the given permission, is not permitted
to the appliction or sub-application represented by this
application security context object. The set of permissions
granted to an entity is be a function of receiver policy,
possibly influenced by user settings,
application signer, and permission request file.p - A permission object representing the resource for which
access is being checked.NullPointerException - if p is nulljava.lang.SecurityException - if this application has not been
granted access to the resource represneted by p.public java.lang.Object doPrivileged(java.security.PrivilegedAction action)
action - the action to be performed.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||