java.lang.Object | |
↳ | java.security.Policy |
Policy
is the common super type of classes which represent a system
security policy. The Policy
specifies which permissions apply to
which code sources.
The system policy can be changed by setting the 'policy.provider'
property in the file named JAVA_HOME/lib/security/java.security
to
the fully qualified class name of the desired Policy
.
Only one instance of a Policy
is active at any time.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a
PermissionCollection describing what permissions are
allowed for the specified CodeSource based on the current
security policy. | |||||||||||
Returns a
PermissionCollection describing what permissions are
allowed for the specified ProtectionDomain (more specifically,
its CodeSource ) based on the current security policy. | |||||||||||
Returns the current system security policy.
| |||||||||||
Indicates whether the specified
Permission is implied by the
PermissionCollection of the specified ProtectionDomain . | |||||||||||
Reloads the policy configuration for this
Policy instance. | |||||||||||
Sets the system wide policy.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
|
Returns a PermissionCollection
describing what permissions are
allowed for the specified CodeSource
based on the current
security policy.
Note that this method is not called for classes which are in the system domain (i.e. system classes). System classes are always given full permissions (i.e. AllPermission). This can not be changed by installing a new policy.
cs | the CodeSource to compute the permissions for. |
---|
CodeSource
.
Returns a PermissionCollection
describing what permissions are
allowed for the specified ProtectionDomain
(more specifically,
its CodeSource
) based on the current security policy.
Note that this method is not< called for classes which are in the system domain (i.e. system classes). System classes are always given full permissions (i.e. AllPermission). This can not be changed by installing a new policy.
domain | the ProtectionDomain to compute the permissions for. |
---|
CodeSource
.
Returns the current system security policy. If no policy has been
instantiated then this is done using the security property "policy.provider"
.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
getPolicy
to be granted, otherwise
a SecurityException
will be thrown.
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|
Indicates whether the specified Permission
is implied by the
PermissionCollection
of the specified ProtectionDomain
.
domain | the ProtectionDomain for which the permission should
be granted. |
---|---|
permission | the Permission for which authorization is to be
verified. |
true
if the Permission
is implied by the ProtectionDomain
, false
otherwise.
Reloads the policy configuration for this Policy
instance.
Sets the system wide policy.
If a SecurityManager
is installed, code calling this method needs
the SecurityPermission
setPolicy
to be granted, otherwise
a SecurityException
will be thrown.
policy | the Policy to set. |
---|
SecurityException | if a SecurityManager is installed and the caller does
not have permission to invoke this method.
|
---|