Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/com/sun/net/ssl/SSLPermission.java
38922 views
/*1* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/*26* NOTE: this file was copied from javax.net.ssl.SSLPermission27*/2829package com.sun.net.ssl;3031import java.security.*;32import java.util.Enumeration;33import java.util.Hashtable;34import java.util.StringTokenizer;35import java.security.Permissions;36import java.lang.SecurityManager;3738/**39* This class is for various network permissions.40* An SSLPermission contains a name (also referred to as a "target name") but41* no actions list; you either have the named permission42* or you don't.43* <P>44* The target name is the name of the network permission (see below). The naming45* convention follows the hierarchical property naming convention.46* Also, an asterisk47* may appear at the end of the name, following a ".", or by itself, to48* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard49* match, while "*foo" and "a*b" do not.50* <P>51* The following table lists all the possible SSLPermission target names,52* and for each provides a description of what the permission allows53* and a discussion of the risks of granting code the permission.54* <P>55*56* <table border=1 cellpadding=5>57* <tr>58* <th>Permission Target Name</th>59* <th>What the Permission Allows</th>60* <th>Risks of Allowing this Permission</th>61* </tr>62*63* <tr>64* <td>setHostnameVerifier</td>65* <td>The ability to set a callback which can decide whether to66* allow a mismatch between the host being connected to by67* an HttpsURLConnection and the common name field in68* server certificate.69* </td>70* <td>Malicious71* code can set a verifier that monitors host names visited by72* HttpsURLConnection requests or that allows server certificates73* with invalid common names.74* </td>75* </tr>76*77* <tr>78* <td>getSSLSessionContext</td>79* <td>The ability to get the SSLSessionContext of an SSLSession.80* </td>81* <td>Malicious code may monitor sessions which have been established82* with SSL peers or might invalidate sessions to slow down performance.83* </td>84* </tr>85*86* </table>87*88* @see java.security.BasicPermission89* @see java.security.Permission90* @see java.security.Permissions91* @see java.security.PermissionCollection92* @see java.lang.SecurityManager93*94*95* @author Marianne Mueller96* @author Roland Schemers97*98* @deprecated As of JDK 1.4, this implementation-specific class was99* replaced by {@link javax.net.ssl.SSLPermission}.100*/101@Deprecated102public final class SSLPermission extends BasicPermission {103104private static final long serialVersionUID = -2583684302506167542L;105106/**107* Creates a new SSLPermission with the specified name.108* The name is the symbolic name of the SSLPermission, such as109* "setDefaultAuthenticator", etc. An asterisk110* may appear at the end of the name, following a ".", or by itself, to111* signify a wildcard match.112*113* @param name the name of the SSLPermission.114*/115116public SSLPermission(String name)117{118super(name);119}120121/**122* Creates a new SSLPermission object with the specified name.123* The name is the symbolic name of the SSLPermission, and the124* actions String is currently unused and should be null. This125* constructor exists for use by the <code>Policy</code> object126* to instantiate new Permission objects.127*128* @param name the name of the SSLPermission.129* @param actions should be null.130*/131132public SSLPermission(String name, String actions)133{134super(name, actions);135}136}137138139