|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.security12.sun.security.provider.PolicyParser
The policy for a Java runtime (specifying which permissions are available for code from various principals) is represented as a separate persistent configuration. The configuration may be stored as a flat ASCII file, as a serialized binary file of the Policy class, or as a database.
The Java runtime creates one global Policy object, which is used to represent the static policy configuration file. It is consulted by a ProtectionDomain when the protection domain initializes its set of permissions.
The Policy init
method parses the policy
configuration file, and then
populates the Policy object. The Policy object is agnostic in that
it is not involved in making policy decisions. It is merely the
Java runtime representation of the persistent policy configuration
file.
When a protection domain needs to initialize its set of permissions, it executes code such as the following to ask the global Policy object to populate a Permissions object with the appropriate permissions:
policy = new Policy(); policy.init(); Permissions perms = policy.evaluate(MyCodeSource)
The protection domain passes in a CodeSource object, which encapsulates its codebase (URL) and public key attributes. The Policy object evaluates the global policy in light of who the principal is and returns an appropriate Permissions object.
Policy
,
CodeSource
,
Permissions
,
ProtectionDomain
Inner Class Summary | |
static class |
PolicyParser.GrantEntry
Each grant entry in the policy configuration file is represented by a GrantEntry object. |
static interface |
PolicyParser.ParsingException
|
static class |
PolicyParser.PermissionEntry
Each permission entry in the policy configuration file is represented by a PermissionEntry object. |
Constructor Summary | |
PolicyParser()
Creates a PolicyParser object. |
|
PolicyParser(boolean expandProp)
|
Method Summary | |
void |
add(PolicyParser.GrantEntry ge)
|
String |
getKeyStoreType()
|
String |
getKeyStoreUrl()
Returns the (possibly expanded) keystore location, or null if the expansion fails. |
Enumeration |
grantElements()
Enumerate all the entries in the global policy object. |
static void |
main(String[] arg)
|
void |
read(Reader policy)
Reads a policy configuration into the Policy object using a Reader object. |
boolean |
remove(PolicyParser.GrantEntry ge)
|
void |
replace(PolicyParser.GrantEntry origGe,
PolicyParser.GrantEntry newGe)
|
void |
setKeyStoreType(String type)
|
void |
setKeyStoreUrl(String url)
|
void |
write(Writer policy)
write out the policy |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PolicyParser()
public PolicyParser(boolean expandProp)
Method Detail |
public void read(Reader policy) throws PolicyParser.ParsingException, IOException
policy
- the policy Reader object.public void add(PolicyParser.GrantEntry ge)
public void replace(PolicyParser.GrantEntry origGe, PolicyParser.GrantEntry newGe)
public boolean remove(PolicyParser.GrantEntry ge)
public String getKeyStoreUrl()
public void setKeyStoreUrl(String url)
public String getKeyStoreType()
public void setKeyStoreType(String type)
public Enumeration grantElements()
public void write(Writer policy)
public static void main(String[] arg) throws Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |