import typing

import java
import java.chaquopy
import java.io
import java.lang
import java.security
import java.util

class AuthPermission(java.security.BasicPermission):
    @typing.overload
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, actions: str | java.lang.String, /) -> None: ...

class DestroyFailedException(java.lang.Exception):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...

class Destroyable(java.lang.Object):
    def destroy(self) -> None: ...
    def isDestroyed(self) -> bool: ...

class PrivateCredentialPermission(java.security.Permission):
    def __init__(self, name: str | java.lang.String, actions: str | java.lang.String, /) -> None: ...
    def getActions(self) -> str: ...
    def getCredentialClass(self) -> str: ...
    def getPrincipals(self) -> java.chaquopy.JavaArray[java.chaquopy.JavaArray[java.lang.String]]: ...
    def implies(self, p: java.security.Permission, /) -> bool: ...

class Subject(java.io.Serializable):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, readOnly: bool | java.jboolean | java.lang.Boolean, principals: java.util.Set[java.security.Principal], pubCredentials: java.util.Set[java.lang.Object], privCredentials: java.util.Set[java.lang.Object], /) -> None: ...
    _doAs_0__T = typing.TypeVar('_doAs_0__T')  # <T>
    _doAs_1__T = typing.TypeVar('_doAs_1__T')  # <T>
    @typing.overload
    @staticmethod
    def doAs(subject: Subject, action: java.security.PrivilegedAction[_doAs_0__T], /) -> _doAs_0__T: ...
    @typing.overload
    @staticmethod
    def doAs(subject: Subject, action: java.security.PrivilegedExceptionAction[_doAs_1__T], /) -> _doAs_1__T: ...
    _doAsPrivileged_0__T = typing.TypeVar('_doAsPrivileged_0__T')  # <T>
    _doAsPrivileged_1__T = typing.TypeVar('_doAsPrivileged_1__T')  # <T>
    @typing.overload
    @staticmethod
    def doAsPrivileged(subject: Subject, action: java.security.PrivilegedAction[_doAsPrivileged_0__T], acc: java.security.AccessControlContext, /) -> _doAsPrivileged_0__T: ...
    @typing.overload
    @staticmethod
    def doAsPrivileged(subject: Subject, action: java.security.PrivilegedExceptionAction[_doAsPrivileged_1__T], acc: java.security.AccessControlContext, /) -> _doAsPrivileged_1__T: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    _getPrincipals_1__T = typing.TypeVar('_getPrincipals_1__T')  # <T>
    @typing.overload
    def getPrincipals(self) -> java.util.Set[java.security.Principal]: ...
    @typing.overload
    def getPrincipals(self, c: typing.Type[_getPrincipals_1__T], /) -> java.util.Set[_getPrincipals_1__T]: ...
    _getPrivateCredentials_1__T = typing.TypeVar('_getPrivateCredentials_1__T')  # <T>
    @typing.overload
    def getPrivateCredentials(self) -> java.util.Set[java.lang.Object]: ...
    @typing.overload
    def getPrivateCredentials(self, c: typing.Type[_getPrivateCredentials_1__T], /) -> java.util.Set[_getPrivateCredentials_1__T]: ...
    _getPublicCredentials_1__T = typing.TypeVar('_getPublicCredentials_1__T')  # <T>
    @typing.overload
    def getPublicCredentials(self) -> java.util.Set[java.lang.Object]: ...
    @typing.overload
    def getPublicCredentials(self, c: typing.Type[_getPublicCredentials_1__T], /) -> java.util.Set[_getPublicCredentials_1__T]: ...
    @staticmethod
    def getSubject(acc: java.security.AccessControlContext, /) -> Subject: ...
    def hashCode(self) -> int: ...
    def isReadOnly(self) -> bool: ...
    def setReadOnly(self) -> None: ...
    def toString(self) -> str: ...

class SubjectDomainCombiner(java.security.DomainCombiner):
    def __init__(self, subject: Subject, /) -> None: ...
    def combine(self, currentDomains: java.chaquopy.JavaArray[java.security.ProtectionDomain], assignedDomains: java.chaquopy.JavaArray[java.security.ProtectionDomain], /) -> java.chaquopy.JavaArray[java.security.ProtectionDomain]: ...
    def getSubject(self) -> Subject: ...
