mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8284851: Update javax.crypto files to use proper javadoc for mentioned classes
Reviewed-by: weijun, valeriep
This commit is contained in:
parent
8cdead0c94
commit
f804f2ce8e
92 changed files with 2142 additions and 2010 deletions
|
@ -41,16 +41,16 @@ import sun.security.util.FilePermCompat;
|
|||
import sun.security.util.SecurityConstants;
|
||||
|
||||
/**
|
||||
* The ProtectionDomain class encapsulates the characteristics of a domain,
|
||||
* which encloses a set of classes whose instances are granted a set
|
||||
* The {@code ProtectionDomain} class encapsulates the characteristics of a
|
||||
* domain, which encloses a set of classes whose instances are granted a set
|
||||
* of permissions when being executed on behalf of a given set of Principals.
|
||||
* <p>
|
||||
* A static set of permissions can be bound to a ProtectionDomain when it is
|
||||
* constructed; such permissions are granted to the domain regardless of the
|
||||
* Policy in force. However, to support dynamic security policies, a
|
||||
* ProtectionDomain can also be constructed such that it is dynamically
|
||||
* mapped to a set of permissions by the current Policy whenever a permission
|
||||
* is checked.
|
||||
* A static set of permissions can be bound to a {@code ProtectionDomain}
|
||||
* when it is constructed; such permissions are granted to the domain
|
||||
* regardless of the policy in force. However, to support dynamic security
|
||||
* policies, a {@code ProtectionDomain} can also be constructed such that it
|
||||
* is dynamically mapped to a set of permissions by the current policy whenever
|
||||
* a permission is checked.
|
||||
*
|
||||
* @author Li Gong
|
||||
* @author Roland Schemers
|
||||
|
@ -61,8 +61,9 @@ import sun.security.util.SecurityConstants;
|
|||
public class ProtectionDomain {
|
||||
|
||||
/**
|
||||
* If true, {@link #impliesWithAltFilePerm} will try to be compatible on
|
||||
* FilePermission checking even if a 3rd-party Policy implementation is set.
|
||||
* If {@code true}, {@link #impliesWithAltFilePerm} will try to be
|
||||
* compatible on FilePermission checking even if a 3rd-party Policy
|
||||
* implementation is set.
|
||||
*/
|
||||
private static final boolean filePermCompatInPD =
|
||||
"true".equals(GetPropertyAction.privilegedGetProperty(
|
||||
|
@ -158,15 +159,16 @@ public class ProtectionDomain {
|
|||
final Key key = new Key();
|
||||
|
||||
/**
|
||||
* Creates a new ProtectionDomain with the given CodeSource and
|
||||
* Permissions. If the permissions object is not null, then
|
||||
* {@code setReadOnly()} will be called on the passed in
|
||||
* Permissions object.
|
||||
* Creates a new {@code ProtectionDomain} with the given {@code CodeSource}
|
||||
* and permissions. If permissions is not {@code null}, then
|
||||
* {@code setReadOnly()} will be called on the passed in
|
||||
* permissions.
|
||||
* <p>
|
||||
* The permissions granted to this domain are static, i.e.
|
||||
* invoking the {@link #staticPermissionsOnly()} method returns true.
|
||||
* invoking the {@link #staticPermissionsOnly()} method returns
|
||||
* {@code true}.
|
||||
* They contain only the ones passed to this constructor and
|
||||
* the current Policy will not be consulted.
|
||||
* the current policy will not be consulted.
|
||||
*
|
||||
* @param codesource the codesource associated with this domain
|
||||
* @param permissions the permissions granted to this domain
|
||||
|
@ -188,30 +190,31 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new ProtectionDomain qualified by the given CodeSource,
|
||||
* Permissions, ClassLoader and array of Principals. If the
|
||||
* permissions object is not null, then {@code setReadOnly()}
|
||||
* will be called on the passed in Permissions object.
|
||||
* Creates a new {@code ProtectionDomain} qualified by the given
|
||||
* {@code CodeSource}, permissions, {@code ClassLoader} and array
|
||||
* of principals. If permissions is not {@code null}, then
|
||||
* {@code setReadOnly()} will be called on the passed in permissions.
|
||||
* <p>
|
||||
* The permissions granted to this domain are dynamic, i.e.
|
||||
* invoking the {@link #staticPermissionsOnly()} method returns false.
|
||||
* invoking the {@link #staticPermissionsOnly()} method returns
|
||||
* {@code false}.
|
||||
* They include both the static permissions passed to this constructor,
|
||||
* and any permissions granted to this domain by the current Policy at the
|
||||
* and any permissions granted to this domain by the current policy at the
|
||||
* time a permission is checked.
|
||||
* <p>
|
||||
* This constructor is typically used by
|
||||
* {@link SecureClassLoader ClassLoaders}
|
||||
* and {@link DomainCombiner DomainCombiners} which delegate to
|
||||
* {@code Policy} to actively associate the permissions granted to
|
||||
* and {@link DomainCombiner DomainCombiners} which delegate to the
|
||||
* {@code Policy} object to actively associate the permissions granted to
|
||||
* this domain. This constructor affords the
|
||||
* Policy provider the opportunity to augment the supplied
|
||||
* PermissionCollection to reflect policy changes.
|
||||
* policy provider the opportunity to augment the supplied
|
||||
* {@code PermissionCollection} to reflect policy changes.
|
||||
*
|
||||
* @param codesource the CodeSource associated with this domain
|
||||
* @param codesource the {@code CodeSource} associated with this domain
|
||||
* @param permissions the permissions granted to this domain
|
||||
* @param classloader the ClassLoader associated with this domain
|
||||
* @param principals the array of Principals associated with this
|
||||
* domain. The contents of the array are copied to protect against
|
||||
* @param classloader the {@code ClassLoader} associated with this domain
|
||||
* @param principals the array of {@code Principal} objects associated
|
||||
* with this domain. The contents of the array are copied to protect against
|
||||
* subsequent modification.
|
||||
* @see Policy#refresh
|
||||
* @see Policy#getPermissions(ProtectionDomain)
|
||||
|
@ -237,8 +240,8 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the CodeSource of this domain.
|
||||
* @return the CodeSource of this domain which may be null.
|
||||
* Returns the {@code CodeSource} of this domain.
|
||||
* @return the {@code CodeSource} of this domain which may be {@code null}.
|
||||
* @since 1.2
|
||||
*/
|
||||
public final CodeSource getCodeSource() {
|
||||
|
@ -247,8 +250,8 @@ public class ProtectionDomain {
|
|||
|
||||
|
||||
/**
|
||||
* Returns the ClassLoader of this domain.
|
||||
* @return the ClassLoader of this domain which may be null.
|
||||
* Returns the {@code ClassLoader} of this domain.
|
||||
* @return the {@code ClassLoader} of this domain which may be {@code null}.
|
||||
*
|
||||
* @since 1.4
|
||||
*/
|
||||
|
@ -271,7 +274,8 @@ public class ProtectionDomain {
|
|||
/**
|
||||
* Returns the static permissions granted to this domain.
|
||||
*
|
||||
* @return the static set of permissions for this domain which may be null.
|
||||
* @return the static set of permissions for this domain which may be
|
||||
* {@code null}.
|
||||
* @see Policy#refresh
|
||||
* @see Policy#getPermissions(ProtectionDomain)
|
||||
*/
|
||||
|
@ -280,11 +284,11 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns true if this domain contains only static permissions
|
||||
* Returns {@code true} if this domain contains only static permissions
|
||||
* and does not check the current {@code Policy} at the time of
|
||||
* permission checking.
|
||||
*
|
||||
* @return true if this domain contains only static permissions.
|
||||
* @return {@code true} if this domain contains only static permissions.
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
|
@ -293,24 +297,25 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check and see if this ProtectionDomain implies the permissions
|
||||
* expressed in the Permission object.
|
||||
* Check and see if this {@code ProtectionDomain} implies the permissions
|
||||
* expressed in the {@code Permission} object.
|
||||
* <p>
|
||||
* The set of permissions evaluated is a function of whether the
|
||||
* ProtectionDomain was constructed with a static set of permissions
|
||||
* {@code ProtectionDomain} was constructed with a static set of permissions
|
||||
* or it was bound to a dynamically mapped set of permissions.
|
||||
* <p>
|
||||
* If the {@link #staticPermissionsOnly()} method returns
|
||||
* true, then the permission will only be checked against the
|
||||
* PermissionCollection supplied at construction.
|
||||
* {@code true}, then the permission will only be checked against the
|
||||
* {@code PermissionCollection} supplied at construction.
|
||||
* <p>
|
||||
* Otherwise, the permission will be checked against the combination
|
||||
* of the PermissionCollection supplied at construction and
|
||||
* the current Policy binding.
|
||||
* of the {@code PermissionCollection} supplied at construction and
|
||||
* the current policy binding.
|
||||
*
|
||||
* @param perm the Permission object to check.
|
||||
* @param perm the {code Permission} object to check.
|
||||
*
|
||||
* @return true if {@code perm} is implied by this ProtectionDomain.
|
||||
* @return {@code true} if {@code perm} is implied by this
|
||||
* {@code ProtectionDomain}.
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
public boolean implies(Permission perm) {
|
||||
|
@ -400,7 +405,7 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Convert a ProtectionDomain to a String.
|
||||
* Convert a {@code ProtectionDomain} to a {@code String}.
|
||||
*/
|
||||
@Override public String toString() {
|
||||
String pals = "<no principals>";
|
||||
|
@ -441,18 +446,18 @@ public class ProtectionDomain {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return true (merge policy permissions) in the following cases:
|
||||
* Return {@code true} (merge policy permissions) in the following cases:
|
||||
*
|
||||
* . SecurityManager is null
|
||||
* . SecurityManager is {@code null}
|
||||
*
|
||||
* . SecurityManager is not null,
|
||||
* debug is not null,
|
||||
* . SecurityManager is not {@code null},
|
||||
* debug is not {@code null},
|
||||
* SecurityManager implementation is in bootclasspath,
|
||||
* Policy implementation is in bootclasspath
|
||||
* (the bootclasspath restrictions avoid recursion)
|
||||
*
|
||||
* . SecurityManager is not null,
|
||||
* debug is null,
|
||||
* . SecurityManager is not {@code null},
|
||||
* debug is {@code null},
|
||||
* caller has Policy.getPolicy permission
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue