public final class SSLPermission extends BasicPermission
目标名称是网络权限的名称(见下文)。命名约定遵循分层属性命名约定。另外,星号可以出现在名称的末尾,下面一个“。”,或本身,意味着一个通配符匹配。例如:“foo。*”、“*”表示一个通配符匹配,而“foo”和“一个”不。
下表列出了所有可能的sslpermission目标名称,并为每个提供了一个描述什么权限允许和给代码权限的风险的讨论。
Permission Target Name | What the Permission Allows | Risks of Allowing this Permission |
---|---|---|
setHostnameVerifier | The ability to set a callback which can decide whether to allow a mismatch between the host being connected to by an HttpsURLConnection and the common name field in server certificate. | Malicious code can set a verifier that monitors host names visited by HttpsURLConnection requests or that allows server certificates with invalid common names. |
getSSLSessionContext | The ability to get the SSLSessionContext of an SSLSession. | Malicious code may monitor sessions which have been established with SSL peers or might invalidate sessions to slow down performance. |
setDefaultSSLContext | The ability to set the default SSL context | Malicious code can set a context that monitors the opening of connections or the plaintext data that is transmitted. |
BasicPermission
,
Permission
,
Permissions
,
PermissionCollection
,
SecurityManager
,
Serialized Form
Constructor and Description |
---|
SSLPermission(String name)
创建具有指定名称的新sslpermission。
|
SSLPermission(String name, String actions)
创建一个新的具有指定名称的sslpermission对象。
|
equals, getActions, hashCode, implies, newPermissionCollection
checkGuard, getName, toString
public SSLPermission(String name)
name
的sslpermission名称。
NullPointerException
-如果
name
是空的。
IllegalArgumentException
-如果
name
是空的。
public SSLPermission(String name, String actions)
name
的sslpermission名称。
actions
忽略。
NullPointerException
-如果
name
是空的。
IllegalArgumentException
-如果
name
是空的。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.