jif.types.principal
Interface Principal
- All Superinterfaces:
- java.lang.Cloneable, polyglot.util.Copy, Param, java.io.Serializable, polyglot.types.TypeObject
- All Known Subinterfaces:
- BottomPrincipal, ConjunctivePrincipal, DisjunctivePrincipal, DynamicPrincipal, ExternalPrincipal, ParamPrincipal, TopPrincipal, UnknownPrincipal
- All Known Implementing Classes:
- BottomPrincipal_c, ConjunctivePrincipal_c, DisjunctivePrincipal_c, DynamicPrincipal_c, ExternalPrincipal_c, ParamPrincipal_c, Principal_c, TopPrincipal_c, UnknownPrincipal_c
public interface Principal
- extends Param
The root interface of all kinds of Jif principals.
Methods inherited from interface polyglot.types.TypeObject |
equalsImpl, position, typeSystem |
Methods inherited from interface polyglot.util.Copy |
copy |
subst
Principal subst(LabelSubstitution labelSubst)
throws polyglot.types.SemanticException
- Parameters:
labelSubst
- The LabelSubstitution
to apply to this
principal
- Returns:
- the result of applying labelSubst to this principal.
- Throws:
polyglot.types.SemanticException
labelCheck
PathMap labelCheck(JifContext A,
LabelChecker lc)
- Label check the principal, which will determine how much information may be
gained if the principal is evaluated at runtime. For example, given the
dynamic principal p, where p is a local variable, evaluation of this
label at runtime will reveal as much information as the label of p. For
example, the following code is illegal, as the runtime evaluation of the
principal reveals too much information
boolean{Alice:} secret = ...;
final principal{Alice:} p = secret?Bob:Chuck;
boolean{} leak = false;
if (p actsfor Bob) { // evaluation of p reveals
// information at level {Alice:}
leak = true;
}
- See Also:
Jif.labelCheck(LabelChecker)
,
Label.labelCheck(JifContext, LabelChecker)
toJava
polyglot.ast.Expr toJava(JifToJavaRewriter rw)
throws polyglot.types.SemanticException
- Throws:
polyglot.types.SemanticException
throwTypes
java.util.List throwTypes(polyglot.types.TypeSystem ts)
- If the principal is runtime representable, when it is evaluated at
runtime it may throw exceptions. This method returns a list of
the exceptions that the runtime evaluation of the principal may produce.
If the principal cannot be evaluated at runtime, an empty list should be returned.
isTopPrincipal
boolean isTopPrincipal()
isBottomPrincipal
boolean isBottomPrincipal()