mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +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
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -35,36 +35,36 @@ import sun.security.util.SecurityConstants;
|
|||
|
||||
|
||||
/**
|
||||
* A Policy object is responsible for determining whether code executing
|
||||
* A {@code Policy} object is responsible for determining whether code executing
|
||||
* in the Java runtime environment has permission to perform a
|
||||
* security-sensitive operation.
|
||||
*
|
||||
* <p> There is only one Policy object installed in the runtime at any
|
||||
* given time. A Policy object can be installed by calling the
|
||||
* {@code setPolicy} method. The installed Policy object can be
|
||||
* <p> There is only one {@code Policy} object installed in the runtime at any
|
||||
* given time. A {@code Policy} object can be installed by calling the
|
||||
* {@code setPolicy} method. The installed {@code Policy} object can be
|
||||
* obtained by calling the {@code getPolicy} method.
|
||||
*
|
||||
* <p> If no Policy object has been installed in the runtime, a call to
|
||||
* {@code getPolicy} installs an instance of the default Policy
|
||||
* <p> If no {@code Policy} object has been installed in the runtime, a call to
|
||||
* {@code getPolicy} installs an instance of the default {@code Policy}
|
||||
* implementation (a default subclass implementation of this abstract class).
|
||||
* The default Policy implementation can be changed by setting the value
|
||||
* The default {@code Policy} implementation can be changed by setting the value
|
||||
* of the {@code policy.provider} security property to the fully qualified
|
||||
* name of the desired Policy subclass implementation. The system class loader
|
||||
* is used to load this class.
|
||||
* name of the desired {@code Policy} subclass implementation. The system
|
||||
* class loader is used to load this class.
|
||||
*
|
||||
* <p> Application code can directly subclass Policy to provide a custom
|
||||
* implementation. In addition, an instance of a Policy object can be
|
||||
* <p> Application code can directly subclass {@code Policy} to provide a custom
|
||||
* implementation. In addition, an instance of a {@code Policy} object can be
|
||||
* constructed by invoking one of the {@code getInstance} factory methods
|
||||
* with a standard type. The default policy type is "JavaPolicy".
|
||||
*
|
||||
* <p> Once a Policy instance has been installed (either by default, or by
|
||||
* calling {@code setPolicy}), the Java runtime invokes its
|
||||
* <p> Once a {@code Policy} instance has been installed (either by default,
|
||||
* or by calling {@code setPolicy}), the Java runtime invokes its
|
||||
* {@code implies} method when it needs to
|
||||
* determine whether executing code (encapsulated in a ProtectionDomain)
|
||||
* can perform SecurityManager-protected operations. How a Policy object
|
||||
* retrieves its policy data is up to the Policy implementation itself.
|
||||
* The policy data may be stored, for example, in a flat ASCII file,
|
||||
* in a serialized binary file of the Policy class, or in a database.
|
||||
* can perform SecurityManager-protected operations. How a {@code Policy}
|
||||
* object retrieves its policy data is up to the {@code Policy} implementation
|
||||
* itself. The policy data may be stored, for example, in a flat ASCII file,
|
||||
* in a serialized binary file of the {@code Policy} class, or in a database.
|
||||
*
|
||||
* <p> The {@code refresh} method causes the policy object to
|
||||
* refresh/reload its data. This operation is implementation-dependent.
|
||||
|
@ -72,7 +72,7 @@ import sun.security.util.SecurityConstants;
|
|||
* calling {@code refresh} will cause it to re-read the configuration
|
||||
* policy files. If a refresh operation is not supported, this method does
|
||||
* nothing. Note that refreshed policy may not have an effect on classes
|
||||
* in a particular ProtectionDomain. This is dependent on the Policy
|
||||
* in a particular ProtectionDomain. This is dependent on the policy
|
||||
* provider's implementation of the {@code implies}
|
||||
* method and its PermissionCollection caching strategy.
|
||||
*
|
||||
|
@ -147,19 +147,19 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the installed Policy object. This value should not be cached,
|
||||
* as it may be changed by a call to {@code setPolicy}.
|
||||
* Returns the installed {@code Policy} object. This value should not be
|
||||
* cached, as it may be changed by a call to {@code setPolicy}.
|
||||
* This method first calls
|
||||
* {@code SecurityManager.checkPermission} with a
|
||||
* {@code SecurityPermission("getPolicy")} permission
|
||||
* to ensure it's ok to get the Policy object.
|
||||
* to ensure it's ok to get the {@code Policy} object.
|
||||
*
|
||||
* @return the installed Policy.
|
||||
*
|
||||
* @throws SecurityException
|
||||
* if a security manager exists and its
|
||||
* {@code checkPermission} method doesn't allow
|
||||
* getting the Policy object.
|
||||
* getting the {@code Policy} object.
|
||||
*
|
||||
* @see SecurityManager#checkPermission(Permission)
|
||||
* @see #setPolicy(java.security.Policy)
|
||||
|
@ -174,10 +174,10 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the installed Policy object, skipping the security check.
|
||||
* Returns the installed {@code Policy} object, skipping the security check.
|
||||
* Used by ProtectionDomain and getPolicy.
|
||||
*
|
||||
* @return the installed Policy.
|
||||
* @return the installed {@code Policy}.
|
||||
*/
|
||||
static Policy getPolicyNoCheck()
|
||||
{
|
||||
|
@ -263,12 +263,12 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets the system-wide Policy object. This method first calls
|
||||
* Sets the system-wide {@code Policy} object. This method first calls
|
||||
* {@code SecurityManager.checkPermission} with a
|
||||
* {@code SecurityPermission("setPolicy")}
|
||||
* permission to ensure it's ok to set the Policy.
|
||||
*
|
||||
* @param p the new system Policy object.
|
||||
* @param p the new system {@code Policy} object.
|
||||
*
|
||||
* @throws SecurityException
|
||||
* if a security manager exists and its
|
||||
|
@ -365,10 +365,10 @@ public abstract class Policy {
|
|||
* Returns a Policy object of the specified type.
|
||||
*
|
||||
* <p> This method traverses the list of registered security providers,
|
||||
* starting with the most preferred Provider.
|
||||
* A new Policy object encapsulating the
|
||||
* PolicySpi implementation from the first
|
||||
* Provider that supports the specified type is returned.
|
||||
* starting with the most preferred provider.
|
||||
* A new {@code Policy} object encapsulating the
|
||||
* {@code PolicySpi} implementation from the first
|
||||
* provider that supports the specified type is returned.
|
||||
*
|
||||
* <p> Note that the list of registered providers may be retrieved via
|
||||
* the {@link Security#getProviders() Security.getProviders()} method.
|
||||
|
@ -387,7 +387,8 @@ public abstract class Policy {
|
|||
* Java Security Standard Algorithm Names Specification</a>
|
||||
* for a list of standard Policy types.
|
||||
*
|
||||
* @param params parameters for the Policy, which may be null.
|
||||
* @param params parameters for the {@code Policy}, which may be
|
||||
* {@code null}.
|
||||
*
|
||||
* @return the new {@code Policy} object
|
||||
*
|
||||
|
@ -426,10 +427,10 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a Policy object of the specified type.
|
||||
* Returns a {@code Policy} object of the specified type.
|
||||
*
|
||||
* <p> A new Policy object encapsulating the
|
||||
* PolicySpi implementation from the specified provider
|
||||
* <p> A new {@code Policy} object encapsulating the
|
||||
* {@code PolicySpi} implementation from the specified provider
|
||||
* is returned. The specified provider must be registered
|
||||
* in the provider list.
|
||||
*
|
||||
|
@ -442,7 +443,8 @@ public abstract class Policy {
|
|||
* Java Security Standard Algorithm Names Specification</a>
|
||||
* for a list of standard Policy types.
|
||||
*
|
||||
* @param params parameters for the Policy, which may be null.
|
||||
* @param params parameters for the {@code Policy}, which may be
|
||||
* {@code null}.
|
||||
*
|
||||
* @param provider the provider.
|
||||
*
|
||||
|
@ -496,12 +498,12 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a Policy object of the specified type.
|
||||
* Returns a {@code Policy} object of the specified type.
|
||||
*
|
||||
* <p> A new Policy object encapsulating the
|
||||
* PolicySpi implementation from the specified Provider
|
||||
* object is returned. Note that the specified Provider object
|
||||
* does not have to be registered in the provider list.
|
||||
* <p> A new {@code Policy} object encapsulating the
|
||||
* {@code PolicySpi} implementation from the specified provider
|
||||
* is returned. Note that the specified provider does not
|
||||
* have to be registered in the provider list.
|
||||
*
|
||||
* @param type the specified Policy type. See the Policy section in the
|
||||
* <a href=
|
||||
|
@ -509,9 +511,10 @@ public abstract class Policy {
|
|||
* Java Security Standard Algorithm Names Specification</a>
|
||||
* for a list of standard Policy types.
|
||||
*
|
||||
* @param params parameters for the Policy, which may be null.
|
||||
* @param params parameters for the {@code Policy}, which may be
|
||||
* {@code null}.
|
||||
*
|
||||
* @param provider the Provider.
|
||||
* @param provider the {@code Provider}.
|
||||
*
|
||||
* @return the new {@code Policy} object
|
||||
*
|
||||
|
@ -569,13 +572,13 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the Provider of this Policy.
|
||||
* Return the {@code Provider} of this policy.
|
||||
*
|
||||
* <p> This Policy instance will only have a Provider if it
|
||||
* <p> This {@code Policy} instance will only have a provider if it
|
||||
* was obtained via a call to {@code Policy.getInstance}.
|
||||
* Otherwise this method returns null.
|
||||
* Otherwise this method returns {@code null}.
|
||||
*
|
||||
* @return the Provider of this Policy, or null.
|
||||
* @return the {@code Provider} of this policy, or {@code null}.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
|
@ -584,13 +587,13 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return the type of this Policy.
|
||||
* Return the type of this {@code Policy}.
|
||||
*
|
||||
* <p> This Policy instance will only have a type if it
|
||||
* <p> This {@code Policy} instance will only have a type if it
|
||||
* was obtained via a call to {@code Policy.getInstance}.
|
||||
* Otherwise this method returns null.
|
||||
* Otherwise this method returns {@code null}.
|
||||
*
|
||||
* @return the type of this Policy, or null.
|
||||
* @return the type of this {@code Policy}, or {@code null}.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
|
@ -599,13 +602,13 @@ public abstract class Policy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return Policy parameters.
|
||||
* Return {@code Policy} parameters.
|
||||
*
|
||||
* <p> This Policy instance will only have parameters if it
|
||||
* <p> This {@code Policy} instance will only have parameters if it
|
||||
* was obtained via a call to {@code Policy.getInstance}.
|
||||
* Otherwise this method returns null.
|
||||
* Otherwise this method returns {@code null}.
|
||||
*
|
||||
* @return Policy parameters, or null.
|
||||
* @return {@code Policy} parameters, or {@code null}.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
|
@ -733,7 +736,7 @@ public abstract class Policy {
|
|||
* @param domain the ProtectionDomain to test
|
||||
* @param permission the Permission object to be tested for implication.
|
||||
*
|
||||
* @return true if "permission" is a proper subset of a permission
|
||||
* @return {@code true} if "permission" is a proper subset of a permission
|
||||
* granted to this ProtectionDomain.
|
||||
*
|
||||
* @see java.security.ProtectionDomain
|
||||
|
@ -779,8 +782,8 @@ public abstract class Policy {
|
|||
public void refresh() { }
|
||||
|
||||
/**
|
||||
* This subclass is returned by the getInstance calls. All Policy calls
|
||||
* are delegated to the underlying PolicySpi.
|
||||
* This subclass is returned by the getInstance calls. All {@code Policy}
|
||||
* calls are delegated to the underlying {@code PolicySpi}.
|
||||
*/
|
||||
private static class PolicyDelegate extends Policy {
|
||||
|
||||
|
@ -839,7 +842,7 @@ public abstract class Policy {
|
|||
* This class represents a read-only empty PermissionCollection object that
|
||||
* is returned from the {@code getPermissions(CodeSource)} and
|
||||
* {@code getPermissions(ProtectionDomain)}
|
||||
* methods in the Policy class when those operations are not
|
||||
* methods in the {@code Policy} class when those operations are not
|
||||
* supported by the Policy implementation.
|
||||
*/
|
||||
private static class UnsupportedEmptyCollection
|
||||
|
@ -877,8 +880,8 @@ public abstract class Policy {
|
|||
*
|
||||
* @param permission the Permission object to compare.
|
||||
*
|
||||
* @return true if "permission" is implied by the permissions in
|
||||
* the collection, false if not.
|
||||
* @return {@code true} if "permission" is implied by the permissions in
|
||||
* the collection, {@code false} if not.
|
||||
*/
|
||||
@Override public boolean implies(Permission permission) {
|
||||
return perms.implies(permission);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue