public class SecurityUtil extends Object
Constructor and Description |
---|
SecurityUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
checkAllLinkPermission()
Throws an
SecurityException if an installed SecurityManager
does not permit to dynamically link to all libraries. |
static void |
checkAllPermissions()
Throws an
SecurityException if an installed SecurityManager
does not permit the requested AllPermission . |
static void |
checkLinkPermission(String libName)
Throws an
SecurityException if an installed SecurityManager
does not permit to dynamically link the given libName. |
static void |
checkPermission(Permission perm)
Throws an
SecurityException if an installed SecurityManager
does not permit the requested Permission . |
static boolean |
equals(Certificate[] a,
Certificate[] b) |
static Certificate[] |
getCerts(Class<?> clz) |
static boolean |
hasAllPermissions()
Returns
true if no SecurityManager has been installed
or the installed SecurityManager 's checkPermission(new AllPermission())
passes. |
static boolean |
hasLinkPermission(String libName)
Returns
true if no SecurityManager has been installed
or the installed SecurityManager 's checkLink(libName)
passes. |
static boolean |
hasPermission(Permission perm)
Returns
true if no SecurityManager has been installed
or the installed SecurityManager 's checkPermission(perm)
passes. |
public static final boolean hasAllPermissions()
true
if no SecurityManager
has been installed
or the installed SecurityManager
's checkPermission(new AllPermission())
passes. Otherwise method returns false
.public static final boolean hasPermission(Permission perm)
true
if no SecurityManager
has been installed
or the installed SecurityManager
's checkPermission(perm)
passes. Otherwise method returns false
.public static final void checkAllPermissions() throws SecurityException
SecurityException
if an installed SecurityManager
does not permit the requested AllPermission
.SecurityException
public static final void checkPermission(Permission perm) throws SecurityException
SecurityException
if an installed SecurityManager
does not permit the requested Permission
.SecurityException
public static final boolean hasLinkPermission(String libName)
true
if no SecurityManager
has been installed
or the installed SecurityManager
's checkLink(libName)
passes. Otherwise method returns false
.public static final void checkLinkPermission(String libName) throws SecurityException
SecurityException
if an installed SecurityManager
does not permit to dynamically link the given libName.SecurityException
public static final void checkAllLinkPermission() throws SecurityException
SecurityException
if an installed SecurityManager
does not permit to dynamically link to all libraries.SecurityException
public static final Certificate[] getCerts(Class<?> clz) throws SecurityException
clz
- SecurityException
- if the caller has no permission to access the ProtectedDomain of the given class.public static final boolean equals(Certificate[] a, Certificate[] b)