jaulib v1.3.0
Jau Support Library (C++, Java, ..)
Static Public Member Functions | List of all members
org.jau.sec.SecurityUtil Class Reference
Collaboration diagram for org.jau.sec.SecurityUtil:

Static Public Member Functions

static final SecurityManager getSecurityManager ()
 Call wrapper for System#getSecurityManager(). More...
 
static< T > T doPrivileged (final PrivilegedAction< T > o)
 Call wrapper for java.security.AccessController#doPrivileged(PrivilegedAction). More...
 
static final boolean hasAllPermissions ()
 Returns true if no SecurityManager has been installed or the installed SecurityManager's checkPermission(new AllPermission()) passes. More...
 
static final boolean hasPermission (final Permission perm)
 Returns true if no SecurityManager has been installed or the installed SecurityManager's checkPermission(perm) passes. More...
 
static final void checkAllPermissions () throws SecurityException
 Throws an SecurityException if an installed SecurityManager does not permit the requested AllPermission. More...
 
static final void checkPermission (final Permission perm) throws SecurityException
 Throws an SecurityException if an installed SecurityManager does not permit the requested Permission. More...
 
static final boolean hasLinkPermission (final String libName)
 Returns true if no SecurityManager has been installed or the installed SecurityManager's checkLink(libName) passes. More...
 
static final void checkLinkPermission (final String libName) throws SecurityException
 Throws an SecurityException if an installed SecurityManager does not permit to dynamically link the given libName. More...
 
static final void checkAllLinkPermission () throws SecurityException
 Throws an SecurityException if an installed SecurityManager does not permit to dynamically link to all libraries. More...
 
static final Certificate[] getCerts (final Class<?> clz) throws SecurityException
 
static final boolean equals (final Certificate[] a, final Certificate[] b)
 

Detailed Description

Definition at line 37 of file SecurityUtil.java.

Member Function Documentation

◆ checkAllLinkPermission()

static final void org.jau.sec.SecurityUtil.checkAllLinkPermission ( ) throws SecurityException
static

Throws an SecurityException if an installed SecurityManager does not permit to dynamically link to all libraries.

Definition at line 194 of file SecurityUtil.java.

◆ checkAllPermissions()

static final void org.jau.sec.SecurityUtil.checkAllPermissions ( ) throws SecurityException
static

Throws an SecurityException if an installed SecurityManager does not permit the requested AllPermission.

Definition at line 149 of file SecurityUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkLinkPermission()

static final void org.jau.sec.SecurityUtil.checkLinkPermission ( final String  libName) throws SecurityException
static

Throws an SecurityException if an installed SecurityManager does not permit to dynamically link the given libName.

Definition at line 183 of file SecurityUtil.java.

Here is the caller graph for this function:

◆ checkPermission()

static final void org.jau.sec.SecurityUtil.checkPermission ( final Permission  perm) throws SecurityException
static

Throws an SecurityException if an installed SecurityManager does not permit the requested Permission.

Definition at line 158 of file SecurityUtil.java.

Here is the caller graph for this function:

◆ doPrivileged()

static< T > T org.jau.sec.SecurityUtil.doPrivileged ( final PrivilegedAction< T >  o)
static

Call wrapper for java.security.AccessController#doPrivileged(PrivilegedAction).

java.security.AccessController#doPrivileged(PrivilegedAction) is deprecated since Java 17 (JEP 411) and earmarked to be removed.

On a Java 17 machine, this method will simply invoke the given PrivilegedAction<T>.

Parameters
<T>return type of PrivilegedAction<T>
othe PrivilegedAction<T>
Returns
the return type

Definition at line 76 of file SecurityUtil.java.

Here is the caller graph for this function:

◆ equals()

static final boolean org.jau.sec.SecurityUtil.equals ( final Certificate[]  a,
final Certificate[]  b 
)
static

Definition at line 213 of file SecurityUtil.java.

◆ getCerts()

static final Certificate[] org.jau.sec.SecurityUtil.getCerts ( final Class<?>  clz) throws SecurityException
static
Parameters
clz
Returns
Exceptions
SecurityExceptionif the caller has no permission to access the ProtectedDomain of the given class.

Definition at line 206 of file SecurityUtil.java.

◆ getSecurityManager()

static final SecurityManager org.jau.sec.SecurityUtil.getSecurityManager ( )
static

Call wrapper for System#getSecurityManager().

System#getSecurityManager() is deprecated since Java 17 (JEP 411) and earmarked to be removed.

On a Java 17 machine, this method will simply return null.

Definition at line 54 of file SecurityUtil.java.

Here is the caller graph for this function:

◆ hasAllPermissions()

static final boolean org.jau.sec.SecurityUtil.hasAllPermissions ( )
static

Returns true if no SecurityManager has been installed or the installed SecurityManager's checkPermission(new AllPermission()) passes.

Otherwise method returns false.

Definition at line 127 of file SecurityUtil.java.

Here is the call graph for this function:

◆ hasLinkPermission()

static final boolean org.jau.sec.SecurityUtil.hasLinkPermission ( final String  libName)
static

Returns true if no SecurityManager has been installed or the installed SecurityManager's checkLink(libName) passes.

Otherwise method returns false.

Definition at line 169 of file SecurityUtil.java.

Here is the call graph for this function:

◆ hasPermission()

static final boolean org.jau.sec.SecurityUtil.hasPermission ( final Permission  perm)
static

Returns true if no SecurityManager has been installed or the installed SecurityManager's checkPermission(perm) passes.

Otherwise method returns false.

Definition at line 136 of file SecurityUtil.java.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: