Package net.jini.security.proxytrust
Class BasicUntrustedObjectSecurityContext
java.lang.Object
net.jini.security.proxytrust.BasicUntrustedObjectSecurityContext
- All Implemented Interfaces:
UntrustedObjectSecurityContext
public final class BasicUntrustedObjectSecurityContext
extends Object
implements UntrustedObjectSecurityContext
A basic trust verifier context element that provides a security context to use to restrict
privileges when invoking methods on untrusted objects, based on a specified set of permissions.
- Since:
- 2.1
- Author:
- Sun Microsystems, Inc.
-
Constructor Summary
ConstructorsConstructorDescriptionBasicUntrustedObjectSecurityContext(Permission[] permissions) Constructs an instance with the specified permissions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the specified object and this object are both instances of this class that were constructed with equivalent permissions.Returns a security context to use to restrict privileges when invoking methods on untrusted objects.inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this object.
-
Constructor Details
-
BasicUntrustedObjectSecurityContext
Constructs an instance with the specified permissions. The security context returned bygetContextwill be restricted to the permissions granted by default to all code plus the additional specified permissions. The argument passed to the constructor is neither modified nor retained; subsequent changes to that argument have no effect on the instance created.- Parameters:
permissions- additional permissions to allow, ornullif no additional permissions should be allowed- Throws:
NullPointerException- if any element of the argument isnull
-
-
Method Details
-
getContext
Returns a security context to use to restrict privileges when invoking methods on untrusted objects. The returned context is equivalent to the current security context (as returned bySecurity.getContext) with an additional protection domain combined into the access control context that contains an emptyCodeSource(nulllocation and certificates), a permission collection containing the permissions used to construct this instance,nullclass loader, andnullprincipals.- Specified by:
getContextin interfaceUntrustedObjectSecurityContext- Returns:
- a security context to use to restrict privileges when invoking methods on untrusted objects
-
toString
Returns a string representation of this object. -
equals
Returnstrueif the specified object and this object are both instances of this class that were constructed with equivalent permissions. The order of permissions in the array that was passed to the constructor is not significant. -
hashCode
public int hashCode()Returns a hash code value for this object.
-