Methods Summary |
---|
public abstract void | addIdentity(java.security.Identity identity)Adds an identity to this identity scope.
|
private static void | check(java.lang.String directive)
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkSecurityAccess(directive);
}
|
public abstract java.security.Identity | getIdentity(java.security.PublicKey key)Retrieves the identity with the specified public key.
|
public abstract java.security.Identity | getIdentity(java.lang.String name)Returns the identity in this scope with the specified name (if any).
|
public java.security.Identity | getIdentity(java.security.Principal principal)Retrieves the identity whose name is the same as that of the
specified principal. (Note: Identity implements Principal.)
return getIdentity(principal.getName());
|
public static java.security.IdentityScope | getSystemScope()Returns the system's identity scope.
if (scope == null) {
initializeSystemScope();
}
return scope;
|
public abstract java.util.Enumeration | identities()Returns an enumeration of all identities in this identity scope.
|
private static void | initializeSystemScope()
// initialize the system scope
String classname = (String) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return Security.getProperty("system.scope");
}
});
if (classname == null) {
return;
} else {
try {
Class.forName(classname);
} catch (ClassNotFoundException e) {
//Security.error("unable to establish a system scope from " +
// classname);
e.printStackTrace();
}
}
|
public abstract void | removeIdentity(java.security.Identity identity)Removes an identity from this identity scope.
|
protected static void | setSystemScope(java.security.IdentityScope scope)Sets the system's identity scope.
First, if there is a security manager, its
checkSecurityAccess
method is called with "setSystemScope"
as its argument to see if it's ok to set the identity scope.
check("setSystemScope");
IdentityScope.scope = scope;
|
public abstract int | size()Returns the number of identities within this identity scope.
|
public java.lang.String | toString()Returns a string representation of this identity scope, including
its name, its scope name, and the number of identities in this
identity scope.
return super.toString() + "[" + size() + "]";
|