jif.lang
Class PrincipalUtil

java.lang.Object
  extended by jif.lang.PrincipalUtil

public class PrincipalUtil
extends java.lang.Object

Utility methods for principals. See the Jif source code, in lib-src/jif/lang/PrincipalUtil.jif


Constructor Summary
PrincipalUtil()
           
 
Method Summary
static boolean acts_for(Principal p, Principal q)
          Returns true if and only if the principal p acts for the principal q.
static boolean actsFor(Principal p, Principal q)
          Returns true if and only if the principal p acts for the principal q.
static Capability authorize(Principal p, java.lang.Object authPrf, Closure c, Label lb)
          Obtain a Capability for the given principal and closure.
static Principal bottomPrincipal()
           
static Principal conjunction(java.util.Collection principals)
           
static Principal conjunction(Principal left, Principal right)
           
static boolean delegatesTo(Principal granter, Principal superior)
           
static Principal disjunction(java.util.Collection principals)
           
static Principal disjunction(Principal left, Principal right)
           
static boolean equals(Principal p, Principal q)
           
static boolean equivalentTo(Principal p, Principal q)
           
static ActsForProof findActsForProof(Principal p, Principal q, java.lang.Object searchState)
          Search for an ActsForProof between p and q.
static Principal nullPrincipal()
          returns the null principal, the principal that every other principal can act for.
static ConfPolicy readableByPrinPolicy(Principal p)
           
static java.lang.String stringValue(Principal p)
           
static Principal topPrincipal()
           
static java.lang.String toString(Principal p)
           
static boolean verifyProof(ActsForProof prf, Principal actor, Principal granter)
          Verify that the chain is a valid delegates-chain between p and q.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrincipalUtil

public PrincipalUtil()
Method Detail

acts_for

public static boolean acts_for(Principal p,
                               Principal q)
Returns true if and only if the principal p acts for the principal q. A synonym for the actsFor method.


actsFor

public static boolean actsFor(Principal p,
                              Principal q)
Returns true if and only if the principal p acts for the principal q.


findActsForProof

public static ActsForProof findActsForProof(Principal p,
                                            Principal q,
                                            java.lang.Object searchState)
Search for an ActsForProof between p and q. An ActsForProof between p and q is a a checkable proof object.

Parameters:
p -
q -
searchState - records the goals that we are in the middle of attempting
Returns:
An ActsForPoorf between p and q, or null if none can be found.

verifyProof

public static boolean verifyProof(ActsForProof prf,
                                  Principal actor,
                                  Principal granter)
Verify that the chain is a valid delegates-chain between p and q. That is, q == chain[n], chain[n] delegates to chain[n-1], ..., chain[0] == p, i.e., p acts for q.


delegatesTo

public static boolean delegatesTo(Principal granter,
                                  Principal superior)

equivalentTo

public static boolean equivalentTo(Principal p,
                                   Principal q)

equals

public static boolean equals(Principal p,
                             Principal q)

authorize

public static Capability authorize(Principal p,
                                   java.lang.Object authPrf,
                                   Closure c,
                                   Label lb)
Obtain a Capability for the given principal and closure.


nullPrincipal

public static Principal nullPrincipal()
returns the null principal, the principal that every other principal can act for.


bottomPrincipal

public static Principal bottomPrincipal()

topPrincipal

public static Principal topPrincipal()

readableByPrinPolicy

public static ConfPolicy readableByPrinPolicy(Principal p)

disjunction

public static Principal disjunction(Principal left,
                                    Principal right)

conjunction

public static Principal conjunction(Principal left,
                                    Principal right)

disjunction

public static Principal disjunction(java.util.Collection principals)

conjunction

public static Principal conjunction(java.util.Collection principals)

toString

public static java.lang.String toString(Principal p)

stringValue

public static java.lang.String stringValue(Principal p)