public class SecurityUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.util.Set<java.lang.String> |
INTERNAL_CLASS_NAMES
A list of all security classes that can forward a check call and should be ignored.
|
| Constructor and Description |
|---|
SecurityUtil() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static java.lang.String |
buildClassFileName(java.lang.String name)
Creates a valid filename using a fully qualified class name.
|
static boolean |
checkCaller(java.lang.String allowed)
Checks the call stack to see if the caller is the method specified.
|
static boolean |
checkCaller(java.lang.String allowed,
java.lang.String ignore)
Checks the call stack to see if the caller is the method specified.
|
static void |
checkCallerAbort(java.lang.String allowed)
Checks the call stack to see if the caller is the method specified.
|
static void |
checkCallerAbort(java.lang.String[] allowed)
Checks the call stack to see if the caller is any of the methods
specified.
|
static void |
checkCallerAbort(java.lang.String[] allowed,
java.lang.String ignore)
Checks the call stack to see if the caller is any of the methods
specified.
|
static void |
checkCallerAbort(java.lang.String allowed,
java.lang.String ignore)
Checks the call stack to see if the caller is the method specified.
|
private static boolean |
checkCallerWorker(java.lang.String[] allowed,
java.lang.StringBuilder entry,
java.lang.String ignore)
Checks the call stack to see if the caller is the method specified.
|
(package private) static boolean |
classExists(java.lang.String name)
Checks the validity (existence) of a class, first creating a filename
using a given fully qualified class name.
|
(package private) static byte[] |
getClassBytes(java.lang.String name)
Gets a byte array filled with the binary class data for the given
class.
|
static byte[] |
packageIdPassword(java.lang.String userid,
java.lang.String password)
Package a user ID and password into a single entity for transmission.
|
private static final java.util.Set<java.lang.String> INTERNAL_CLASS_NAMES
public static byte[] packageIdPassword(java.lang.String userid,
java.lang.String password)
userid - The subject ID.password - The password.public static void checkCallerAbort(java.lang.String[] allowed,
java.lang.String ignore)
throws RestrictedUseException
The closest entry to the top of the stack where the class name differs
from both the SecurityManager and the given
ignore class name is the entry checked.
A function of SecurityManager can be specified as the
allowed function. In this case it should be the closest entry to the
top except ignore class functions and other functions of
SecurityManager.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A list of fully qualified (package.class.method) names from
which the call is allowed.ignore - A class name of entries (other than that of the
SecurityManager) which should be ignored at
the top of the stack. May be null.RestrictedUseException - If the check fails.public static void checkCallerAbort(java.lang.String[] allowed)
throws RestrictedUseException
The closest entry to the top of the stack where the class name differs
from the SecurityManager is the entry checked.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A list of fully qualified (package.class.method) names from
which the call is allowed.RestrictedUseException - If the check fails.public static void checkCallerAbort(java.lang.String allowed,
java.lang.String ignore)
throws RestrictedUseException
The closest entry to the top of the stack where the class name differs
from both the SecurityManager and the given
ignore class name is the entry checked.
A function of SecurityManager can be specified as the
allowed function. In this case it should be the closest entry to the
top except ignore class functions and other functions of
SecurityManager.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A fully qualified (package.class.method) name from which the
call is allowed.ignore - A class name of entries (other than that of the
SecurityManager) which should be ignored at
the top of the stack. May be null.RestrictedUseException - If the check fails.public static void checkCallerAbort(java.lang.String allowed)
throws RestrictedUseException
The closest entry to the top of the stack where the class name differs
from the SecurityManager is the entry checked.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A fully qualified (package.class.method) name from which the
call is allowed.RestrictedUseException - If the check fails.public static boolean checkCaller(java.lang.String allowed,
java.lang.String ignore)
The closest entry to the top of the stack where the class name differs
from both the SecurityManager and the given
ignore class name is the entry checked.
A function of SecurityManager can be specified as the
allowed function. In this case it should be the closest entry to the
top except ignore class functions and other functions of
SecurityManager.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A fully qualified (package.class.method) name from which the
call is allowed.ignore - A class name of entries (other than that of the
SecurityManager) which should be ignored at
the top of the stack. May be null.true if allowed.public static boolean checkCaller(java.lang.String allowed)
The closest entry to the top of the stack where the class name differs
from both the SecurityManager is the entry checked.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A fully qualified (package.class.method) name from which the
call is allowed.true if allowed.private static boolean checkCallerWorker(java.lang.String[] allowed,
java.lang.StringBuilder entry,
java.lang.String ignore)
The closest entry to the top of the stack where the class name differs
from both the SecurityManager and the given
ignore class name is the entry checked.
A function of SecurityManager can be specified as the
allowed function. In this case it should be the closest entry to the
top except ignore class functions and other functions of
SecurityManager.
This arrangement allows for multiple levels of calls within this class and the class which is checking the caller without affecting the check.
allowed - A list of fully qualified (package.class.method) names from
which the call is allowed.entry - Optional user-supplied buffer so that on failure the invalid
value will be available. May be null if not
needed by the caller.ignore - A class name of entries (other than that of the
SecurityManager) which should be ignored at
the top of the stack. May be null.true if allowed.static java.lang.String buildClassFileName(java.lang.String name)
name - A fully qualified class name (without the ".class" at the
end). Note that any "." characters are converted into the
system-specific file separators.static boolean classExists(java.lang.String name)
name - A fully qualified class name (without the ".class" at the
end). Note that any "." characters are converted into path
separators.true if the class file exists.static byte[] getClassBytes(java.lang.String name)
name - A fully qualified class name (without the ".class" at the
end).