Класс AuthPermission
- java.lang.Object
- java.security.Permission
- java.security.BasicPermission
- javax.security.auth.AuthPermission
- Все реализованные интерфейсы:
-
Serializable,Guard
public final class AuthPermission extends BasicPermission
Этот класс предназначен для разрешений на аутентификацию. Разрешение AuthPermission содержит имя (также называемое «именем цели»), но не список действий; у вас есть разрешение с данным именем или нет.
Имя цели — это имя параметра конфигурации безопасности (см. ниже). В настоящее время объект AuthPermission используется для защиты доступа к объектам Subject, LoginContext и Configuration.
Стандартные имена целей для разрешения на аутентификацию:
doAs - allow the caller to invoke the
Subject.doAs methods.
doAsPrivileged - allow the caller to invoke the
Subject.doAsPrivileged methods.
getSubject - allow for the retrieval of the
Subject(s) associated with the
current Thread.
getSubjectFromDomainCombiner - allow for the retrieval of the
Subject associated with the
a SubjectDomainCombiner.
setReadOnly - allow the caller to set a Subject
to be read-only.
modifyPrincipals - allow the caller to modify the Set
of Principals associated with a
Subject
modifyPublicCredentials - allow the caller to modify the
Set of public credentials
associated with a Subject
modifyPrivateCredentials - allow the caller to modify the
Set of private credentials
associated with a Subject
refreshCredential - allow code to invoke the refresh
method on a credential which implements
the Refreshable interface.
destroyCredential - allow code to invoke the destroy
method on a credential object
which implements the Destroyable
interface.
createLoginContext.{name} - allow code to instantiate a
LoginContext with the
specified name. name
is used as the index into the installed login
Configuration
(that returned by
Configuration.getConfiguration()).
name can be wildcarded (set to '*')
to allow for any name.
getLoginConfiguration - allow for the retrieval of the system-wide
login Configuration.
createLoginConfiguration.{type} - allow code to obtain a Configuration
object via
Configuration.getInstance.
setLoginConfiguration - allow for the setting of the system-wide
login Configuration.
refreshLoginConfiguration - allow for the refreshing of the system-wide
login Configuration. Обратите внимание, что предоставление этого разрешения с целевыми именами «modifyPrincipals», «modifyPublicCredentials» или «modifyPrivateCredentials» позволяет модулю входа JAAS заполнять объекты принципала или учетных данных в субъекте. Хотя чтение информации внутри набора частных учетных данных требует предоставления разрешения PrivateCredentialPermission соответствующего типа учетных данных, чтение информации внутри набора принципалов и набора общедоступных учетных данных не требует дополнительных разрешений. Эти объекты могут содержать потенциально конфиденциальную информацию. Например, модули входа, которые считывают локальную информацию о пользователе или выполняют вход Kerberos, могут добавлять потенциально конфиденциальную информацию, такую как идентификаторы пользователей, группы и доменные имена, в набор принципалов.
Следующее имя цели устарело в пользу createLoginContext.{name}.
createLoginContext - allow code to instantiate a
LoginContext.
- Примечание по реализации:
- Реализации могут определять дополнительные имена целей, но должны использовать соглашения об именовании, такие как обратный домен, чтобы избежать конфликтов имён.
- С:
- 1.4
- См. также:
- Сериализованная форма
Конструкторы
| Конструктор | Описание |
|---|---|
AuthPermission(String name) | Создаёт новый AuthPermission с указанным именем. |
AuthPermission(String name,
String actions) | Создаёт новый объект AuthPermission с указанным именем. |
Методы
Методы, объявленные в классе java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection Методы, объявленные в классе java.security.Permission
checkGuard, getName, toString Методы, объявленные в классе java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait Конструкторы
AuthPermission
public AuthPermission(String name)
Создаёт новый AuthPermission с указанным именем. Имя — это символическое имя AuthPermission.
- Параметры:
-
name- имя AuthPermission - Исключения:
-
NullPointerException- еслиnameявляетсяnull. -
IllegalArgumentException- еслиnameпустое.
AuthPermission
public AuthPermission(String name,
String actions) Создаёт новый объект AuthPermission с указанным именем. Имя — это символическое имя AuthPermission, а строка действий в настоящее время не используется и должна быть null.
- Параметры:
-
name- имя AuthPermission -
actions- должно быть null. - Исключения:
-
NullPointerException- еслиnameявляетсяnull. -
IllegalArgumentException- еслиnameпустое.
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/javax/security/auth/AuthPermission.html