author | erikj |
Tue, 12 Sep 2017 19:03:39 +0200 | |
changeset 47216 | 71c04702a3d5 |
parent 40416 | jdk/src/java.base/share/classes/sun/security/util/SecurityConstants.java@5d91b2fd668c |
child 49925 | 3deb300f0e55 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
40416
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36511
diff
changeset
|
2 |
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.security.util; |
|
27 |
||
28 |
import java.net.SocketPermission; |
|
29 |
import java.net.NetPermission; |
|
3956
2586d23078e4
6854954: Eliminate static dependency on java.awt.AWTPermission
alanb
parents:
2057
diff
changeset
|
30 |
import java.security.AccessController; |
2586d23078e4
6854954: Eliminate static dependency on java.awt.AWTPermission
alanb
parents:
2057
diff
changeset
|
31 |
import java.security.PrivilegedAction; |
2586d23078e4
6854954: Eliminate static dependency on java.awt.AWTPermission
alanb
parents:
2057
diff
changeset
|
32 |
import java.security.Permission; |
2586d23078e4
6854954: Eliminate static dependency on java.awt.AWTPermission
alanb
parents:
2057
diff
changeset
|
33 |
import java.security.BasicPermission; |
2 | 34 |
import java.security.SecurityPermission; |
35 |
import java.security.AllPermission; |
|
40416
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36511
diff
changeset
|
36 |
import sun.security.action.GetPropertyAction; |
2 | 37 |
|
38 |
/** |
|
39 |
* Permission constants and string constants used to create permissions |
|
40 |
* used throughout the JDK. |
|
41 |
*/ |
|
42 |
public final class SecurityConstants { |
|
43 |
// Cannot create one of these |
|
44 |
private SecurityConstants () { |
|
45 |
} |
|
46 |
||
47 |
// Commonly used string constants for permission actions used by |
|
48 |
// SecurityManager. Declare here for shortcut when checking permissions |
|
49 |
// in FilePermission, SocketPermission, and PropertyPermission. |
|
50 |
||
51 |
public static final String FILE_DELETE_ACTION = "delete"; |
|
52 |
public static final String FILE_EXECUTE_ACTION = "execute"; |
|
53 |
public static final String FILE_READ_ACTION = "read"; |
|
54 |
public static final String FILE_WRITE_ACTION = "write"; |
|
2057
3acf8e5e2ca0
6781363: New I/O: Update socket-channel API to jsr203/nio2-b99
alanb
parents:
2
diff
changeset
|
55 |
public static final String FILE_READLINK_ACTION = "readlink"; |
2 | 56 |
|
57 |
public static final String SOCKET_RESOLVE_ACTION = "resolve"; |
|
58 |
public static final String SOCKET_CONNECT_ACTION = "connect"; |
|
59 |
public static final String SOCKET_LISTEN_ACTION = "listen"; |
|
60 |
public static final String SOCKET_ACCEPT_ACTION = "accept"; |
|
61 |
public static final String SOCKET_CONNECT_ACCEPT_ACTION = "connect,accept"; |
|
62 |
||
63 |
public static final String PROPERTY_RW_ACTION = "read,write"; |
|
64 |
public static final String PROPERTY_READ_ACTION = "read"; |
|
65 |
public static final String PROPERTY_WRITE_ACTION = "write"; |
|
66 |
||
67 |
// Permission constants used in the various checkPermission() calls in JDK. |
|
68 |
||
69 |
// java.lang.Class, java.lang.SecurityManager, java.lang.System, |
|
70 |
// java.net.URLConnection, java.security.AllPermission, java.security.Policy, |
|
71 |
// sun.security.provider.PolicyFile |
|
72 |
public static final AllPermission ALL_PERMISSION = new AllPermission(); |
|
73 |
||
74 |
// java.net.URL |
|
75 |
public static final NetPermission SPECIFY_HANDLER_PERMISSION = |
|
76 |
new NetPermission("specifyStreamHandler"); |
|
77 |
||
78 |
// java.net.ProxySelector |
|
79 |
public static final NetPermission SET_PROXYSELECTOR_PERMISSION = |
|
80 |
new NetPermission("setProxySelector"); |
|
81 |
||
82 |
// java.net.ProxySelector |
|
83 |
public static final NetPermission GET_PROXYSELECTOR_PERMISSION = |
|
84 |
new NetPermission("getProxySelector"); |
|
85 |
||
86 |
// java.net.CookieHandler |
|
87 |
public static final NetPermission SET_COOKIEHANDLER_PERMISSION = |
|
88 |
new NetPermission("setCookieHandler"); |
|
89 |
||
90 |
// java.net.CookieHandler |
|
91 |
public static final NetPermission GET_COOKIEHANDLER_PERMISSION = |
|
92 |
new NetPermission("getCookieHandler"); |
|
93 |
||
94 |
// java.net.ResponseCache |
|
95 |
public static final NetPermission SET_RESPONSECACHE_PERMISSION = |
|
96 |
new NetPermission("setResponseCache"); |
|
97 |
||
98 |
// java.net.ResponseCache |
|
99 |
public static final NetPermission GET_RESPONSECACHE_PERMISSION = |
|
100 |
new NetPermission("getResponseCache"); |
|
101 |
||
36511 | 102 |
// java.lang.SecurityManager, sun.applet.AppletPanel |
2 | 103 |
public static final RuntimePermission CREATE_CLASSLOADER_PERMISSION = |
104 |
new RuntimePermission("createClassLoader"); |
|
105 |
||
106 |
// java.lang.SecurityManager |
|
107 |
public static final RuntimePermission CHECK_MEMBER_ACCESS_PERMISSION = |
|
108 |
new RuntimePermission("accessDeclaredMembers"); |
|
109 |
||
110 |
// java.lang.SecurityManager, sun.applet.AppletSecurity |
|
111 |
public static final RuntimePermission MODIFY_THREAD_PERMISSION = |
|
112 |
new RuntimePermission("modifyThread"); |
|
113 |
||
114 |
// java.lang.SecurityManager, sun.applet.AppletSecurity |
|
115 |
public static final RuntimePermission MODIFY_THREADGROUP_PERMISSION = |
|
116 |
new RuntimePermission("modifyThreadGroup"); |
|
117 |
||
118 |
// java.lang.Class |
|
119 |
public static final RuntimePermission GET_PD_PERMISSION = |
|
120 |
new RuntimePermission("getProtectionDomain"); |
|
121 |
||
122 |
// java.lang.Class, java.lang.ClassLoader, java.lang.Thread |
|
123 |
public static final RuntimePermission GET_CLASSLOADER_PERMISSION = |
|
124 |
new RuntimePermission("getClassLoader"); |
|
125 |
||
126 |
// java.lang.Thread |
|
127 |
public static final RuntimePermission STOP_THREAD_PERMISSION = |
|
128 |
new RuntimePermission("stopThread"); |
|
129 |
||
130 |
// java.lang.Thread |
|
131 |
public static final RuntimePermission GET_STACK_TRACE_PERMISSION = |
|
132 |
new RuntimePermission("getStackTrace"); |
|
133 |
||
134 |
// java.security.AccessControlContext |
|
135 |
public static final SecurityPermission CREATE_ACC_PERMISSION = |
|
136 |
new SecurityPermission("createAccessControlContext"); |
|
137 |
||
138 |
// java.security.AccessControlContext |
|
139 |
public static final SecurityPermission GET_COMBINER_PERMISSION = |
|
140 |
new SecurityPermission("getDomainCombiner"); |
|
141 |
||
142 |
// java.security.Policy, java.security.ProtectionDomain |
|
143 |
public static final SecurityPermission GET_POLICY_PERMISSION = |
|
144 |
new SecurityPermission ("getPolicy"); |
|
145 |
||
146 |
// java.lang.SecurityManager |
|
147 |
public static final SocketPermission LOCAL_LISTEN_PERMISSION = |
|
22339 | 148 |
new SocketPermission("localhost:0", SOCKET_LISTEN_ACTION); |
40416
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36511
diff
changeset
|
149 |
|
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36511
diff
changeset
|
150 |
public static final String PROVIDER_VER = |
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36511
diff
changeset
|
151 |
GetPropertyAction.privilegedGetProperty("java.specification.version"); |
2 | 152 |
} |