public final class SSLPermission extends BasicPermission
目标名称是网络许可的名称(见下文)。 命名约定遵循层次化属性命名约定。 此外,星号可能会出现在名称的末尾,遵循“。”或本身表示通配符匹配。 例如:“foo。*”和“*”表示通配符匹配,而“* foo”和“a * b”则不表示。
下表列出了所有可能的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
-
name
的名称。
NullPointerException
- 如果
name
为空。
IllegalArgumentException
- 如果
name
为空。
public SSLPermission(String name, String actions)
name
-
name
的名称。
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.