java.security

Class SecurityPermission

Implemented Interfaces:
Guard, Serializable

public final class SecurityPermission
extends BasicPermission

This class provides a mechanism for specified named permissions related to the Java security framework. These permissions have no associated actions list. They are either granted or not granted.

The list of valid permission names is:

Permission NamePermission AllowsRisks
createAccessControlContextAllows creation of an AccessControlContextThe new control context can have a rogue DomainCombiner, leading to a privacy leak
getDomainCombinerGet a DomainCombiner from an AccessControlContextAccess to a DomainCombiner can lead to a privacy leak
getPolicyAllows retrieval of the system security policyMalicious code can use information from the policy to better plan an attack
setPolicyAllows the security policy to be changedMalicious code can give itself any permission it wants
getProperty.keyRetrieve the property specified by the keyMalicious code can use information from the property to better plan an attack
setProperty.keyAllows changing of the value of all properties implied by keyMalicious code can insert rogue classes to steal keys or recreate the security policy with whatever permissions it desires
insertProvider.keyAllows the named provider to be addedMalicious code can insert rogue providers that steal data
removeProvider.keyAllows the named provider to be removedA missing provider can cripple code that relies on it
setSystemScopeAllows the system identity scope to be setMalicious code can add certificates not available in the original identity scope, to gain more permissions
setIdentityPublicKeyAllows the public key of an Identity to be setMalicious code can install its own key to gain permissions not allowed by the original identity scope
SetIdentityInfoAllows the description of an Identity to be setMalicious code can spoof users into trusting a fake identity
addIdentityCertificateAllows a certificate to be set for the public key of an identityThe public key can become trusted to a wider audience than originally intended
removeIdentityCertificateAllows removal of a certificate from an identity's public keyThe public key can become less trusted than it should be
printIdentityView the name of the identity and scope, and whether they are trustedThe scope may include a filename, which provides an entry point for further security breaches
clearProviderProperties.keyAllows the properties of the named provider to be clearedThis can disable parts of the program which depend on finding the provider
putProviderProperty.keyAllows the properties of the named provider to be changedMalicious code can replace the implementation of a provider
removeProviderProperty.keyAllows the properties of the named provider to be deletedThis can disable parts of the program which depend on finding the provider
getSignerPrivateKeyAllows the retrieval of the private key for a signerAnyone that can access the private key can claim to be the Signer
setSignerKeyPairAllows the public and private key of a Signer to be changedThe replacement might be a weaker encryption, or the attacker can use knowledge of the replaced key to decrypt an entire communication session

There is some degree of security risk in granting any of these permissions. Some of them can completely compromise system security. Please exercise extreme caution in granting these permissions.

Since:
1.1
See Also:
Permission, SecurityManager, Serialized Form

Constructor Summary

SecurityPermission(String name)
Create a new instance with the specified name.
SecurityPermission(String name, String actions)
Create a new instance with the specified name.

Method Summary

Methods inherited from class java.security.BasicPermission

equals, getActions, hashCode, implies, newPermissionCollection

Methods inherited from class java.security.Permission

checkGuard, equals, getActions, getName, hashCode, implies, newPermissionCollection, toString

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

SecurityPermission

public SecurityPermission(String name)
Create a new instance with the specified name.
Parameters:
name - the name to assign to this permission

SecurityPermission

public SecurityPermission(String name,
                          String actions)
Create a new instance with the specified name. As SecurityPermission carries no actions, the second parameter is ignored.
Parameters:
name - the name to assign to this permission
actions - ignored

SecurityPermission.java -- Class for named security permissions Copyright (C) 1998, 2002 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.