import typing

import java
import java.chaquopy
import java.io
import java.lang
import java.net
import java.nio
import java.security.cert
import java.security.spec
import java.util
import java.util.function
import javax.crypto
import javax.security.auth
import javax.security.auth.callback

class AccessControlContext(java.lang.Object):
    @typing.overload
    def __init__(self, context: java.chaquopy.JavaArray[ProtectionDomain], /) -> None: ...
    @typing.overload
    def __init__(self, acc: AccessControlContext, combiner: DomainCombiner, /) -> None: ...
    def checkPermission(self, perm: Permission, /) -> None: ...
    def getDomainCombiner(self) -> DomainCombiner: ...

class AccessControlException(java.lang.SecurityException):
    @typing.overload
    def __init__(self, s: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, s: str | java.lang.String, p: Permission, /) -> None: ...
    def getPermission(self) -> Permission: ...

class AccessController(java.lang.Object):
    @staticmethod
    def checkPermission(perm: Permission, /) -> None: ...
    _doPrivileged_0__T = typing.TypeVar('_doPrivileged_0__T')  # <T>
    _doPrivileged_1__T = typing.TypeVar('_doPrivileged_1__T')  # <T>
    _doPrivileged_2__T = typing.TypeVar('_doPrivileged_2__T')  # <T>
    _doPrivileged_3__T = typing.TypeVar('_doPrivileged_3__T')  # <T>
    @typing.overload
    @staticmethod
    def doPrivileged(action: PrivilegedAction[_doPrivileged_0__T], /) -> _doPrivileged_0__T: ...
    @typing.overload
    @staticmethod
    def doPrivileged(action: PrivilegedExceptionAction[_doPrivileged_1__T], /) -> _doPrivileged_1__T: ...
    @typing.overload
    @staticmethod
    def doPrivileged(action: PrivilegedAction[_doPrivileged_2__T], context: AccessControlContext, /) -> _doPrivileged_2__T: ...
    @typing.overload
    @staticmethod
    def doPrivileged(action: PrivilegedExceptionAction[_doPrivileged_3__T], context: AccessControlContext, /) -> _doPrivileged_3__T: ...
    _doPrivilegedWithCombiner_0__T = typing.TypeVar('_doPrivilegedWithCombiner_0__T')  # <T>
    _doPrivilegedWithCombiner_1__T = typing.TypeVar('_doPrivilegedWithCombiner_1__T')  # <T>
    @typing.overload
    @staticmethod
    def doPrivilegedWithCombiner(action: PrivilegedAction[_doPrivilegedWithCombiner_0__T], /) -> _doPrivilegedWithCombiner_0__T: ...
    @typing.overload
    @staticmethod
    def doPrivilegedWithCombiner(action: PrivilegedExceptionAction[_doPrivilegedWithCombiner_1__T], /) -> _doPrivilegedWithCombiner_1__T: ...
    @staticmethod
    def getContext() -> AccessControlContext: ...

class AlgorithmConstraints(java.lang.Object):
    @typing.overload
    def permits(self, arg1: java.util.Set[CryptoPrimitive], arg2: Key, /) -> bool: ...
    @typing.overload
    def permits(self, arg1: java.util.Set[CryptoPrimitive], arg2: str | java.lang.String, arg3: AlgorithmParameters, /) -> bool: ...
    @typing.overload
    def permits(self, arg1: java.util.Set[CryptoPrimitive], arg2: str | java.lang.String, arg3: Key, arg4: AlgorithmParameters, /) -> bool: ...

class AlgorithmParameterGenerator(java.lang.Object):
    def __init__(self, paramGenSpi: AlgorithmParameterGeneratorSpi, provider: Provider, algorithm: str | java.lang.String, /) -> None: ...
    def generateParameters(self) -> AlgorithmParameters: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> AlgorithmParameterGenerator: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> AlgorithmParameterGenerator: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> AlgorithmParameterGenerator: ...
    def getProvider(self) -> Provider: ...
    @typing.overload
    def init(self, size: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def init(self, genParamSpec: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def init(self, size: int | java.jint | java.lang.Integer, random: SecureRandom, /) -> None: ...
    @typing.overload
    def init(self, genParamSpec: java.security.spec.AlgorithmParameterSpec, random: SecureRandom, /) -> None: ...

class AlgorithmParameterGeneratorSpi(java.lang.Object):
    def __init__(self) -> None: ...
    def engineGenerateParameters(self) -> AlgorithmParameters: ...
    @typing.overload
    def engineInit(self, arg1: int | java.jint | java.lang.Integer, arg2: SecureRandom, /) -> None: ...
    @typing.overload
    def engineInit(self, arg1: java.security.spec.AlgorithmParameterSpec, arg2: SecureRandom, /) -> None: ...

class AlgorithmParameters(java.lang.Object):
    def __init__(self, paramSpi: AlgorithmParametersSpi, provider: Provider, algorithm: str | java.lang.String, /) -> None: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def getEncoded(self, format: str | java.lang.String, /) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> AlgorithmParameters: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> AlgorithmParameters: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> AlgorithmParameters: ...
    _getParameterSpec__T = typing.TypeVar('_getParameterSpec__T')  # <T>
    def getParameterSpec(self, paramSpec: typing.Type[_getParameterSpec__T], /) -> _getParameterSpec__T: ...
    def getProvider(self) -> Provider: ...
    @typing.overload
    def init(self, paramSpec: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def init(self, params: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def init(self, params: java.chaquopy.JavaArrayJByte, format: str | java.lang.String, /) -> None: ...
    def toString(self) -> str: ...

class AlgorithmParametersSpi(java.lang.Object):
    def __init__(self) -> None: ...
    @typing.overload
    def engineGetEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def engineGetEncoded(self, arg1: str | java.lang.String, /) -> java.chaquopy.JavaArrayJByte: ...
    _engineGetParameterSpec__T = typing.TypeVar('_engineGetParameterSpec__T')  # <T>
    def engineGetParameterSpec(self, arg1: typing.Type[_engineGetParameterSpec__T], /) -> _engineGetParameterSpec__T: ...
    @typing.overload
    def engineInit(self, arg1: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def engineInit(self, arg1: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def engineInit(self, arg1: java.chaquopy.JavaArrayJByte, arg2: str | java.lang.String, /) -> None: ...
    def engineToString(self) -> str: ...

class AllPermission(Permission):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, actions: str | java.lang.String, /) -> None: ...
    def getActions(self) -> str: ...
    def implies(self, p: Permission, /) -> bool: ...

class AuthProvider(Provider):
    def __init__(self, name: str | java.lang.String, version: float | java.jdouble | java.lang.Double, info: str | java.lang.String, /) -> None: ...
    def login(self, arg1: javax.security.auth.Subject, arg2: javax.security.auth.callback.CallbackHandler, /) -> None: ...
    def logout(self) -> None: ...
    def setCallbackHandler(self, arg1: javax.security.auth.callback.CallbackHandler, /) -> None: ...

class BasicPermission(Permission, java.io.Serializable):
    @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: ...
    def getActions(self) -> str: ...
    def implies(self, p: Permission, /) -> bool: ...

class Certificate(java.lang.Object):
    def decode(self, arg1: java.io.InputStream, /) -> None: ...
    def encode(self, arg1: java.io.OutputStream, /) -> None: ...
    def getFormat(self) -> str: ...
    def getGuarantor(self) -> Principal: ...
    def getPrincipal(self) -> Principal: ...
    def getPublicKey(self) -> PublicKey: ...
    def toString(self, arg1: bool | java.jboolean | java.lang.Boolean, /) -> str: ...

class CodeSigner(java.io.Serializable):
    def __init__(self, signerCertPath: java.security.cert.CertPath, timestamp: Timestamp, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getSignerCertPath(self) -> java.security.cert.CertPath: ...
    def getTimestamp(self) -> Timestamp: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...

class CodeSource(java.io.Serializable):
    @typing.overload
    def __init__(self, url: java.net.URL, signers: java.chaquopy.JavaArray[CodeSigner], /) -> None: ...
    @typing.overload
    def __init__(self, url: java.net.URL, certs: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    def getCertificates(self) -> java.chaquopy.JavaArray[java.security.cert.Certificate]: ...
    def getCodeSigners(self) -> java.chaquopy.JavaArray[CodeSigner]: ...
    def getLocation(self) -> java.net.URL: ...
    def implies(self, codesource: CodeSource, /) -> bool: ...

class CryptoPrimitive(java.lang.Enum[CryptoPrimitive]):
    BLOCK_CIPHER: typing.ClassVar[CryptoPrimitive] = ...
    KEY_AGREEMENT: typing.ClassVar[CryptoPrimitive] = ...
    KEY_ENCAPSULATION: typing.ClassVar[CryptoPrimitive] = ...
    KEY_WRAP: typing.ClassVar[CryptoPrimitive] = ...
    MAC: typing.ClassVar[CryptoPrimitive] = ...
    MESSAGE_DIGEST: typing.ClassVar[CryptoPrimitive] = ...
    PUBLIC_KEY_ENCRYPTION: typing.ClassVar[CryptoPrimitive] = ...
    SECURE_RANDOM: typing.ClassVar[CryptoPrimitive] = ...
    SIGNATURE: typing.ClassVar[CryptoPrimitive] = ...
    STREAM_CIPHER: typing.ClassVar[CryptoPrimitive] = ...
    @staticmethod
    def valueOf(name: str | java.lang.String, /) -> CryptoPrimitive: ...
    @staticmethod
    def values() -> java.chaquopy.JavaArray[CryptoPrimitive]: ...

class DigestException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class DigestInputStream(java.io.FilterInputStream):
    digest: MessageDigest = ...
    def __init__(self, stream: java.io.InputStream, digest: MessageDigest, /) -> None: ...
    def getMessageDigest(self) -> MessageDigest: ...
    def on(self, on: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    @typing.overload
    def read(self) -> int: ...
    @typing.overload
    def read(self, b: java.chaquopy.JavaArrayJByte, off: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> int: ...
    def setMessageDigest(self, digest: MessageDigest, /) -> None: ...
    def toString(self) -> str: ...

class DigestOutputStream(java.io.FilterOutputStream):
    digest: MessageDigest = ...
    def __init__(self, stream: java.io.OutputStream, digest: MessageDigest, /) -> None: ...
    def getMessageDigest(self) -> MessageDigest: ...
    def on(self, on: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def setMessageDigest(self, digest: MessageDigest, /) -> None: ...
    def toString(self) -> str: ...
    @typing.overload
    def write(self, b: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def write(self, b: java.chaquopy.JavaArrayJByte, off: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> None: ...

class DomainCombiner(java.lang.Object):
    def combine(self, arg1: java.chaquopy.JavaArray[ProtectionDomain], arg2: java.chaquopy.JavaArray[ProtectionDomain], /) -> java.chaquopy.JavaArray[ProtectionDomain]: ...

class DomainLoadStoreParameter(KeyStore.LoadStoreParameter):
    def __init__(self, configuration: java.net.URI, protectionParams: java.util.Map[java.lang.String, KeyStore.ProtectionParameter], /) -> None: ...
    def getConfiguration(self) -> java.net.URI: ...
    def getProtectionParameter(self) -> KeyStore.ProtectionParameter: ...
    def getProtectionParams(self) -> java.util.Map[java.lang.String, KeyStore.ProtectionParameter]: ...

class DrbgParameters(java.lang.Object):
    @staticmethod
    def instantiation(strength: int | java.jint | java.lang.Integer, capability: DrbgParameters.Capability, personalizationString: java.chaquopy.JavaArrayJByte, /) -> DrbgParameters.Instantiation: ...
    @staticmethod
    def nextBytes(strength: int | java.jint | java.lang.Integer, predictionResistance: bool | java.jboolean | java.lang.Boolean, additionalInput: java.chaquopy.JavaArrayJByte, /) -> DrbgParameters.NextBytes: ...
    @staticmethod
    def reseed(predictionResistance: bool | java.jboolean | java.lang.Boolean, additionalInput: java.chaquopy.JavaArrayJByte, /) -> DrbgParameters.Reseed: ...

    class Reseed(SecureRandomParameters):
        def getAdditionalInput(self) -> java.chaquopy.JavaArrayJByte: ...
        def getPredictionResistance(self) -> bool: ...

    class NextBytes(SecureRandomParameters):
        def getAdditionalInput(self) -> java.chaquopy.JavaArrayJByte: ...
        def getPredictionResistance(self) -> bool: ...
        def getStrength(self) -> int: ...

    class Instantiation(SecureRandomParameters):
        def getCapability(self) -> DrbgParameters.Capability: ...
        def getPersonalizationString(self) -> java.chaquopy.JavaArrayJByte: ...
        def getStrength(self) -> int: ...
        def toString(self) -> str: ...

    class Capability(java.lang.Enum[DrbgParameters.Capability]):
        NONE: typing.ClassVar[DrbgParameters.Capability] = ...
        PR_AND_RESEED: typing.ClassVar[DrbgParameters.Capability] = ...
        RESEED_ONLY: typing.ClassVar[DrbgParameters.Capability] = ...
        def supportsPredictionResistance(self) -> bool: ...
        def supportsReseeding(self) -> bool: ...
        def toString(self) -> str: ...
        @staticmethod
        def valueOf(name: str | java.lang.String, /) -> DrbgParameters.Capability: ...
        @staticmethod
        def values() -> java.chaquopy.JavaArray[DrbgParameters.Capability]: ...

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

class Guard(java.lang.Object):
    def checkGuard(self, arg1: java.lang.Object | int | bool | float | str, /) -> None: ...

class GuardedObject(java.io.Serializable):
    def __init__(self, object: java.lang.Object | int | bool | float | str, guard: Guard, /) -> None: ...
    def getObject(self) -> java.lang.Object: ...

class Identity(Principal, java.io.Serializable):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, scope: IdentityScope, /) -> None: ...
    def addCertificate(self, certificate: Certificate, /) -> None: ...
    def certificates(self) -> java.chaquopy.JavaArray[Certificate]: ...
    def equals(self, identity: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getInfo(self) -> str: ...
    def getName(self) -> str: ...
    def getPublicKey(self) -> PublicKey: ...
    def getScope(self) -> IdentityScope: ...
    def hashCode(self) -> int: ...
    def identityEquals(self, identity: Identity, /) -> bool: ...
    def removeCertificate(self, certificate: Certificate, /) -> None: ...
    def setInfo(self, info: str | java.lang.String, /) -> None: ...
    def setPublicKey(self, key: PublicKey, /) -> None: ...
    @typing.overload
    def toString(self) -> str: ...
    @typing.overload
    def toString(self, detailed: bool | java.jboolean | java.lang.Boolean, /) -> str: ...

class IdentityScope(Identity):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, scope: IdentityScope, /) -> None: ...
    def addIdentity(self, arg1: Identity, /) -> None: ...
    @typing.overload
    def getIdentity(self, arg1: str | java.lang.String, /) -> Identity: ...
    @typing.overload
    def getIdentity(self, principal: Principal, /) -> Identity: ...
    @typing.overload
    def getIdentity(self, arg1: PublicKey, /) -> Identity: ...
    @staticmethod
    def getSystemScope() -> IdentityScope: ...
    def identities(self) -> java.util.Enumeration[Identity]: ...
    def removeIdentity(self, arg1: Identity, /) -> None: ...
    @staticmethod
    def setSystemScope(scope: IdentityScope, /) -> None: ...
    def size(self) -> int: ...
    def toString(self) -> str: ...

class InvalidAlgorithmParameterException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class InvalidKeyException(KeyException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

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

class Key(java.io.Serializable):
    serialVersionUID: typing.ClassVar[int] = ...
    def getAlgorithm(self) -> str: ...
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    def getFormat(self) -> str: ...

class KeyException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class KeyFactory(java.lang.Object):
    def __init__(self, keyFacSpi: KeyFactorySpi, provider: Provider, algorithm: str | java.lang.String, /) -> None: ...
    def generatePrivate(self, keySpec: java.security.spec.KeySpec, /) -> PrivateKey: ...
    def generatePublic(self, keySpec: java.security.spec.KeySpec, /) -> PublicKey: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> KeyFactory: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> KeyFactory: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> KeyFactory: ...
    _getKeySpec__T = typing.TypeVar('_getKeySpec__T')  # <T>
    def getKeySpec(self, key: Key, keySpec: typing.Type[_getKeySpec__T], /) -> _getKeySpec__T: ...
    def getProvider(self) -> Provider: ...
    def translateKey(self, key: Key, /) -> Key: ...

class KeyFactorySpi(java.lang.Object):
    def __init__(self) -> None: ...
    def engineGeneratePrivate(self, arg1: java.security.spec.KeySpec, /) -> PrivateKey: ...
    def engineGeneratePublic(self, arg1: java.security.spec.KeySpec, /) -> PublicKey: ...
    _engineGetKeySpec__T = typing.TypeVar('_engineGetKeySpec__T')  # <T>
    def engineGetKeySpec(self, arg1: Key, arg2: typing.Type[_engineGetKeySpec__T], /) -> _engineGetKeySpec__T: ...
    def engineTranslateKey(self, arg1: Key, /) -> Key: ...

class KeyManagementException(KeyException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class KeyPair(java.io.Serializable):
    def __init__(self, publicKey: PublicKey, privateKey: PrivateKey, /) -> None: ...
    def getPrivate(self) -> PrivateKey: ...
    def getPublic(self) -> PublicKey: ...

class KeyPairGenerator(KeyPairGeneratorSpi):
    def __init__(self, algorithm: str | java.lang.String, /) -> None: ...
    def genKeyPair(self) -> KeyPair: ...
    def generateKeyPair(self) -> KeyPair: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> KeyPairGenerator: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> KeyPairGenerator: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> KeyPairGenerator: ...
    def getProvider(self) -> Provider: ...
    @typing.overload
    def initialize(self, keysize: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def initialize(self, params: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def initialize(self, keysize: int | java.jint | java.lang.Integer, random: SecureRandom, /) -> None: ...
    @typing.overload
    def initialize(self, params: java.security.spec.AlgorithmParameterSpec, random: SecureRandom, /) -> None: ...

class KeyPairGeneratorSpi(java.lang.Object):
    def __init__(self) -> None: ...
    def generateKeyPair(self) -> KeyPair: ...
    @typing.overload
    def initialize(self, arg1: int | java.jint | java.lang.Integer, arg2: SecureRandom, /) -> None: ...
    @typing.overload
    def initialize(self, params: java.security.spec.AlgorithmParameterSpec, random: SecureRandom, /) -> None: ...

class KeyRep(java.io.Serializable):
    def __init__(self, type: KeyRep.Type, algorithm: str | java.lang.String, format: str | java.lang.String, encoded: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def readResolve(self) -> java.lang.Object: ...

    class Type(java.lang.Enum[KeyRep.Type]):
        PRIVATE: typing.ClassVar[KeyRep.Type] = ...
        PUBLIC: typing.ClassVar[KeyRep.Type] = ...
        SECRET: typing.ClassVar[KeyRep.Type] = ...
        @staticmethod
        def valueOf(name: str | java.lang.String, /) -> KeyRep.Type: ...
        @staticmethod
        def values() -> java.chaquopy.JavaArray[KeyRep.Type]: ...

class KeyStore(java.lang.Object):
    def __init__(self, keyStoreSpi: KeyStoreSpi, provider: Provider, type: str | java.lang.String, /) -> None: ...
    def aliases(self) -> java.util.Enumeration[java.lang.String]: ...
    def containsAlias(self, alias: str | java.lang.String, /) -> bool: ...
    def deleteEntry(self, alias: str | java.lang.String, /) -> None: ...
    def entryInstanceOf(self, alias: str | java.lang.String, entryClass: typing.Type[KeyStore.Entry], /) -> bool: ...
    def getCertificate(self, alias: str | java.lang.String, /) -> java.security.cert.Certificate: ...
    def getCertificateAlias(self, cert: java.security.cert.Certificate, /) -> str: ...
    def getCertificateChain(self, alias: str | java.lang.String, /) -> java.chaquopy.JavaArray[java.security.cert.Certificate]: ...
    def getCreationDate(self, alias: str | java.lang.String, /) -> java.util.Date: ...
    @staticmethod
    def getDefaultType() -> str: ...
    def getEntry(self, alias: str | java.lang.String, protParam: KeyStore.ProtectionParameter, /) -> KeyStore.Entry: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, /) -> KeyStore: ...
    @typing.overload
    @staticmethod
    def getInstance(file: java.io.File, param: KeyStore.LoadStoreParameter, /) -> KeyStore: ...
    @typing.overload
    @staticmethod
    def getInstance(file: java.io.File, password: java.chaquopy.JavaArrayJChar, /) -> KeyStore: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, provider: str | java.lang.String, /) -> KeyStore: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, provider: Provider, /) -> KeyStore: ...
    def getKey(self, alias: str | java.lang.String, password: java.chaquopy.JavaArrayJChar, /) -> Key: ...
    def getProvider(self) -> Provider: ...
    def getType(self) -> str: ...
    def isCertificateEntry(self, alias: str | java.lang.String, /) -> bool: ...
    def isKeyEntry(self, alias: str | java.lang.String, /) -> bool: ...
    @typing.overload
    def load(self, param: KeyStore.LoadStoreParameter, /) -> None: ...
    @typing.overload
    def load(self, stream: java.io.InputStream, password: java.chaquopy.JavaArrayJChar, /) -> None: ...
    def setCertificateEntry(self, alias: str | java.lang.String, cert: java.security.cert.Certificate, /) -> None: ...
    def setEntry(self, alias: str | java.lang.String, entry: KeyStore.Entry, protParam: KeyStore.ProtectionParameter, /) -> None: ...
    @typing.overload
    def setKeyEntry(self, alias: str | java.lang.String, key: java.chaquopy.JavaArrayJByte, chain: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    @typing.overload
    def setKeyEntry(self, alias: str | java.lang.String, key: Key, password: java.chaquopy.JavaArrayJChar, chain: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    def size(self) -> int: ...
    @typing.overload
    def store(self, param: KeyStore.LoadStoreParameter, /) -> None: ...
    @typing.overload
    def store(self, stream: java.io.OutputStream, password: java.chaquopy.JavaArrayJChar, /) -> None: ...

    class TrustedCertificateEntry(KeyStore.Entry):
        @typing.overload
        def __init__(self, trustedCert: java.security.cert.Certificate, /) -> None: ...
        @typing.overload
        def __init__(self, trustedCert: java.security.cert.Certificate, attributes: java.util.Set[KeyStore.Entry.Attribute], /) -> None: ...
        def getAttributes(self) -> java.util.Set[KeyStore.Entry.Attribute]: ...
        def getTrustedCertificate(self) -> java.security.cert.Certificate: ...
        def toString(self) -> str: ...

    class SecretKeyEntry(KeyStore.Entry):
        @typing.overload
        def __init__(self, secretKey: javax.crypto.SecretKey, /) -> None: ...
        @typing.overload
        def __init__(self, secretKey: javax.crypto.SecretKey, attributes: java.util.Set[KeyStore.Entry.Attribute], /) -> None: ...
        def getAttributes(self) -> java.util.Set[KeyStore.Entry.Attribute]: ...
        def getSecretKey(self) -> javax.crypto.SecretKey: ...
        def toString(self) -> str: ...

    class ProtectionParameter(java.lang.Object): ...

    class PrivateKeyEntry(KeyStore.Entry):
        @typing.overload
        def __init__(self, privateKey: PrivateKey, chain: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
        @typing.overload
        def __init__(self, privateKey: PrivateKey, chain: java.chaquopy.JavaArray[java.security.cert.Certificate], attributes: java.util.Set[KeyStore.Entry.Attribute], /) -> None: ...
        def getAttributes(self) -> java.util.Set[KeyStore.Entry.Attribute]: ...
        def getCertificate(self) -> java.security.cert.Certificate: ...
        def getCertificateChain(self) -> java.chaquopy.JavaArray[java.security.cert.Certificate]: ...
        def getPrivateKey(self) -> PrivateKey: ...
        def toString(self) -> str: ...

    class PasswordProtection(KeyStore.ProtectionParameter, javax.security.auth.Destroyable):
        @typing.overload
        def __init__(self, password: java.chaquopy.JavaArrayJChar, /) -> None: ...
        @typing.overload
        def __init__(self, password: java.chaquopy.JavaArrayJChar, protectionAlgorithm: str | java.lang.String, protectionParameters: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
        def destroy(self) -> None: ...
        def getPassword(self) -> java.chaquopy.JavaArrayJChar: ...
        def getProtectionAlgorithm(self) -> str: ...
        def getProtectionParameters(self) -> java.security.spec.AlgorithmParameterSpec: ...
        def isDestroyed(self) -> bool: ...

    class LoadStoreParameter(java.lang.Object):
        def getProtectionParameter(self) -> KeyStore.ProtectionParameter: ...

    class Entry(java.lang.Object):
        def getAttributes(self) -> java.util.Set[KeyStore.Entry.Attribute]: ...

        class Attribute(java.lang.Object):
            def getName(self) -> str: ...
            def getValue(self) -> str: ...

    class CallbackHandlerProtection(KeyStore.ProtectionParameter):
        def __init__(self, handler: javax.security.auth.callback.CallbackHandler, /) -> None: ...
        def getCallbackHandler(self) -> javax.security.auth.callback.CallbackHandler: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def getKeyStore(self) -> KeyStore: ...
        def getProtectionParameter(self, arg1: str | java.lang.String, /) -> KeyStore.ProtectionParameter: ...
        @typing.overload
        @staticmethod
        def newInstance(file: java.io.File, protection: KeyStore.ProtectionParameter, /) -> KeyStore.Builder: ...
        @typing.overload
        @staticmethod
        def newInstance(keyStore: KeyStore, protectionParameter: KeyStore.ProtectionParameter, /) -> KeyStore.Builder: ...
        @typing.overload
        @staticmethod
        def newInstance(type: str | java.lang.String, provider: Provider, protection: KeyStore.ProtectionParameter, /) -> KeyStore.Builder: ...
        @typing.overload
        @staticmethod
        def newInstance(type: str | java.lang.String, provider: Provider, file: java.io.File, protection: KeyStore.ProtectionParameter, /) -> KeyStore.Builder: ...

class KeyStoreException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class KeyStoreSpi(java.lang.Object):
    def __init__(self) -> None: ...
    def engineAliases(self) -> java.util.Enumeration[java.lang.String]: ...
    def engineContainsAlias(self, arg1: str | java.lang.String, /) -> bool: ...
    def engineDeleteEntry(self, arg1: str | java.lang.String, /) -> None: ...
    def engineEntryInstanceOf(self, alias: str | java.lang.String, entryClass: typing.Type[KeyStore.Entry], /) -> bool: ...
    def engineGetCertificate(self, arg1: str | java.lang.String, /) -> java.security.cert.Certificate: ...
    def engineGetCertificateAlias(self, arg1: java.security.cert.Certificate, /) -> str: ...
    def engineGetCertificateChain(self, arg1: str | java.lang.String, /) -> java.chaquopy.JavaArray[java.security.cert.Certificate]: ...
    def engineGetCreationDate(self, arg1: str | java.lang.String, /) -> java.util.Date: ...
    def engineGetEntry(self, alias: str | java.lang.String, protParam: KeyStore.ProtectionParameter, /) -> KeyStore.Entry: ...
    def engineGetKey(self, arg1: str | java.lang.String, arg2: java.chaquopy.JavaArrayJChar, /) -> Key: ...
    def engineIsCertificateEntry(self, arg1: str | java.lang.String, /) -> bool: ...
    def engineIsKeyEntry(self, arg1: str | java.lang.String, /) -> bool: ...
    @typing.overload
    def engineLoad(self, param: KeyStore.LoadStoreParameter, /) -> None: ...
    @typing.overload
    def engineLoad(self, arg1: java.io.InputStream, arg2: java.chaquopy.JavaArrayJChar, /) -> None: ...
    def engineProbe(self, stream: java.io.InputStream, /) -> bool: ...
    def engineSetCertificateEntry(self, arg1: str | java.lang.String, arg2: java.security.cert.Certificate, /) -> None: ...
    def engineSetEntry(self, alias: str | java.lang.String, entry: KeyStore.Entry, protParam: KeyStore.ProtectionParameter, /) -> None: ...
    @typing.overload
    def engineSetKeyEntry(self, arg1: str | java.lang.String, arg2: java.chaquopy.JavaArrayJByte, arg3: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    @typing.overload
    def engineSetKeyEntry(self, arg1: str | java.lang.String, arg2: Key, arg3: java.chaquopy.JavaArrayJChar, arg4: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    def engineSize(self) -> int: ...
    @typing.overload
    def engineStore(self, param: KeyStore.LoadStoreParameter, /) -> None: ...
    @typing.overload
    def engineStore(self, arg1: java.io.OutputStream, arg2: java.chaquopy.JavaArrayJChar, /) -> None: ...

class MessageDigest(MessageDigestSpi):
    def __init__(self, algorithm: str | java.lang.String, /) -> None: ...
    def clone(self) -> java.lang.Object: ...
    @typing.overload
    def digest(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def digest(self, input: java.chaquopy.JavaArrayJByte, /) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def digest(self, buf: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> int: ...
    def getAlgorithm(self) -> str: ...
    def getDigestLength(self) -> int: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> MessageDigest: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> MessageDigest: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> MessageDigest: ...
    def getProvider(self) -> Provider: ...
    @staticmethod
    def isEqual(digesta: java.chaquopy.JavaArrayJByte, digestb: java.chaquopy.JavaArrayJByte, /) -> bool: ...
    def reset(self) -> None: ...
    def toString(self) -> str: ...
    @typing.overload
    def update(self, input: int | java.jbyte | java.lang.Byte, /) -> None: ...
    @typing.overload
    def update(self, input: java.nio.ByteBuffer, /) -> None: ...
    @typing.overload
    def update(self, input: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def update(self, input: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> None: ...

class MessageDigestSpi(java.lang.Object):
    def __init__(self) -> None: ...
    def clone(self) -> java.lang.Object: ...
    @typing.overload
    def engineDigest(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def engineDigest(self, buf: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> int: ...
    def engineGetDigestLength(self) -> int: ...
    def engineReset(self) -> None: ...
    @typing.overload
    def engineUpdate(self, arg1: int | java.jbyte | java.lang.Byte, /) -> None: ...
    @typing.overload
    def engineUpdate(self, input: java.nio.ByteBuffer, /) -> None: ...
    @typing.overload
    def engineUpdate(self, arg1: java.chaquopy.JavaArrayJByte, arg2: int | java.jint | java.lang.Integer, arg3: int | java.jint | java.lang.Integer, /) -> None: ...

class NoSuchAlgorithmException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

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

class PKCS12Attribute(KeyStore.Entry.Attribute):
    @typing.overload
    def __init__(self, encoded: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, value: str | java.lang.String, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    def getName(self) -> str: ...
    def getValue(self) -> str: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...

class Permission(Guard, java.io.Serializable):
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    def checkGuard(self, object: java.lang.Object | int | bool | float | str, /) -> None: ...
    def getActions(self) -> str: ...
    def getName(self) -> str: ...
    def implies(self, arg1: Permission, /) -> bool: ...
    def newPermissionCollection(self) -> PermissionCollection: ...

class PermissionCollection(java.io.Serializable):
    def __init__(self) -> None: ...
    def add(self, arg1: Permission, /) -> None: ...
    def elements(self) -> java.util.Enumeration[Permission]: ...
    def implies(self, arg1: Permission, /) -> bool: ...
    def isReadOnly(self) -> bool: ...
    def setReadOnly(self) -> None: ...

class Permissions(PermissionCollection, java.io.Serializable):
    def __init__(self) -> None: ...
    def add(self, permission: Permission, /) -> None: ...
    def elements(self) -> java.util.Enumeration[Permission]: ...
    def implies(self, permission: Permission, /) -> bool: ...

class Policy(java.lang.Object):
    UNSUPPORTED_EMPTY_COLLECTION: typing.ClassVar[PermissionCollection] = ...
    def __init__(self) -> None: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, params: Policy.Parameters, /) -> Policy: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, params: Policy.Parameters, provider: str | java.lang.String, /) -> Policy: ...
    @typing.overload
    @staticmethod
    def getInstance(type: str | java.lang.String, params: Policy.Parameters, provider: Provider, /) -> Policy: ...
    def getParameters(self) -> Policy.Parameters: ...
    @typing.overload
    def getPermissions(self, codesource: CodeSource, /) -> PermissionCollection: ...
    @typing.overload
    def getPermissions(self, domain: ProtectionDomain, /) -> PermissionCollection: ...
    @staticmethod
    def getPolicy() -> Policy: ...
    def getProvider(self) -> Provider: ...
    def getType(self) -> str: ...
    def implies(self, domain: ProtectionDomain, permission: Permission, /) -> bool: ...
    def refresh(self) -> None: ...
    @staticmethod
    def setPolicy(p: Policy, /) -> None: ...

    class Parameters(java.lang.Object): ...

class PolicySpi(java.lang.Object):
    def __init__(self) -> None: ...
    @typing.overload
    def engineGetPermissions(self, codesource: CodeSource, /) -> PermissionCollection: ...
    @typing.overload
    def engineGetPermissions(self, domain: ProtectionDomain, /) -> PermissionCollection: ...
    def engineImplies(self, arg1: ProtectionDomain, arg2: Permission, /) -> bool: ...
    def engineRefresh(self) -> None: ...

class Principal(java.lang.Object):
    def equals(self, arg1: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getName(self) -> str: ...
    def hashCode(self) -> int: ...
    def implies(self, subject: javax.security.auth.Subject, /) -> bool: ...
    def toString(self) -> str: ...

class PrivateKey(Key, javax.security.auth.Destroyable):
    serialVersionUID: typing.ClassVar[int] = ...

_PrivilegedAction__T = typing.TypeVar('_PrivilegedAction__T')  # <T>
class PrivilegedAction(java.lang.Object, typing.Generic[_PrivilegedAction__T]):
    def run(self) -> _PrivilegedAction__T: ...

class PrivilegedActionException(java.lang.Exception):
    def __init__(self, exception: java.lang.Exception, /) -> None: ...
    def getCause(self) -> java.lang.Throwable: ...
    def getException(self) -> java.lang.Exception: ...
    def toString(self) -> str: ...

_PrivilegedExceptionAction__T = typing.TypeVar('_PrivilegedExceptionAction__T')  # <T>
class PrivilegedExceptionAction(java.lang.Object, typing.Generic[_PrivilegedExceptionAction__T]):
    def run(self) -> _PrivilegedExceptionAction__T: ...

class ProtectionDomain(java.lang.Object):
    @typing.overload
    def __init__(self, codesource: CodeSource, permissions: PermissionCollection, /) -> None: ...
    @typing.overload
    def __init__(self, codesource: CodeSource, permissions: PermissionCollection, classloader: java.lang.ClassLoader, principals: java.chaquopy.JavaArray[Principal], /) -> None: ...
    def getClassLoader(self) -> java.lang.ClassLoader: ...
    def getCodeSource(self) -> CodeSource: ...
    def getPermissions(self) -> PermissionCollection: ...
    def getPrincipals(self) -> java.chaquopy.JavaArray[Principal]: ...
    def implies(self, permission: Permission, /) -> bool: ...

class Provider(java.util.Properties):
    def __init__(self, name: str | java.lang.String, version: float | java.jdouble | java.lang.Double, info: str | java.lang.String, /) -> None: ...
    def clear(self) -> None: ...
    def compute(self, key: java.lang.Object | int | bool | float | str, remappingFunction: java.util.function.BiFunction[java.lang.Object, java.lang.Object, java.lang.Object], /) -> java.lang.Object: ...
    def computeIfAbsent(self, key: java.lang.Object | int | bool | float | str, mappingFunction: java.util.function.Function[java.lang.Object, java.lang.Object], /) -> java.lang.Object: ...
    def computeIfPresent(self, key: java.lang.Object | int | bool | float | str, remappingFunction: java.util.function.BiFunction[java.lang.Object, java.lang.Object, java.lang.Object], /) -> java.lang.Object: ...
    def elements(self) -> java.util.Enumeration[java.lang.Object]: ...
    def entrySet(self) -> java.util.Set[java.util.Map.Entry[java.lang.Object, java.lang.Object]]: ...
    def forEach(self, action: java.util.function.BiConsumer[java.lang.Object, java.lang.Object], /) -> None: ...
    def get(self, key: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    def getInfo(self) -> str: ...
    def getName(self) -> str: ...
    def getOrDefault(self, key: java.lang.Object | int | bool | float | str, defaultValue: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    def getProperty(self, key: str | java.lang.String, /) -> str: ...
    def getService(self, type: str | java.lang.String, algorithm: str | java.lang.String, /) -> Provider.Service: ...
    def getServices(self) -> java.util.Set[Provider.Service]: ...
    def getVersion(self) -> float: ...
    def keySet(self) -> java.util.Set[java.lang.Object]: ...
    def keys(self) -> java.util.Enumeration[java.lang.Object]: ...
    def load(self, inStream: java.io.InputStream, /) -> None: ...
    def merge(self, key: java.lang.Object | int | bool | float | str, value: java.lang.Object | int | bool | float | str, remappingFunction: java.util.function.BiFunction[java.lang.Object, java.lang.Object, java.lang.Object], /) -> java.lang.Object: ...
    def put(self, key: java.lang.Object | int | bool | float | str, value: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    def putAll(self, t: java.util.Map[java.lang.Object, java.lang.Object], /) -> None: ...
    def putIfAbsent(self, key: java.lang.Object | int | bool | float | str, value: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    def putService(self, s: Provider.Service, /) -> None: ...
    @typing.overload
    def remove(self, key: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    @typing.overload
    def remove(self, key: java.lang.Object | int | bool | float | str, value: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def removeService(self, s: Provider.Service, /) -> None: ...
    @typing.overload
    def replace(self, key: java.lang.Object | int | bool | float | str, value: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
    @typing.overload
    def replace(self, key: java.lang.Object | int | bool | float | str, oldValue: java.lang.Object | int | bool | float | str, newValue: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def replaceAll(self, function: java.util.function.BiFunction[java.lang.Object, java.lang.Object, java.lang.Object], /) -> None: ...
    def toString(self) -> str: ...
    def values(self) -> java.util.Collection[java.lang.Object]: ...

    class Service(java.lang.Object):
        def __init__(self, provider: Provider, type: str | java.lang.String, algorithm: str | java.lang.String, className: str | java.lang.String, aliases: java.util.List[java.lang.String], attributes: java.util.Map[java.lang.String, java.lang.String], /) -> None: ...
        def getAlgorithm(self) -> str: ...
        def getAttribute(self, name: str | java.lang.String, /) -> str: ...
        def getClassName(self) -> str: ...
        def getProvider(self) -> Provider: ...
        def getType(self) -> str: ...
        def newInstance(self, constructorParameter: java.lang.Object | int | bool | float | str, /) -> java.lang.Object: ...
        def supportsParameter(self, parameter: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def toString(self) -> str: ...

class ProviderException(java.lang.RuntimeException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, s: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class PublicKey(Key):
    serialVersionUID: typing.ClassVar[int] = ...

class SecureClassLoader(java.lang.ClassLoader):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, parent: java.lang.ClassLoader, /) -> None: ...
    @typing.overload
    def defineClass(self, name: str | java.lang.String, b: java.nio.ByteBuffer, cs: CodeSource, /) -> typing.Type[java.lang.Object]: ...
    @typing.overload
    def defineClass(self, name: str | java.lang.String, b: java.chaquopy.JavaArrayJByte, off: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, cs: CodeSource, /) -> typing.Type[java.lang.Object]: ...
    def getPermissions(self, codesource: CodeSource, /) -> PermissionCollection: ...

class SecureRandom(java.util.Random):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, seed: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def __init__(self, secureRandomSpi: SecureRandomSpi, provider: Provider, /) -> None: ...
    def generateSeed(self, numBytes: int | java.jint | java.lang.Integer, /) -> java.chaquopy.JavaArrayJByte: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> SecureRandom: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> SecureRandom: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> SecureRandom: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, params: SecureRandomParameters, /) -> SecureRandom: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, params: SecureRandomParameters, provider: str | java.lang.String, /) -> SecureRandom: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, params: SecureRandomParameters, provider: Provider, /) -> SecureRandom: ...
    @staticmethod
    def getInstanceStrong() -> SecureRandom: ...
    def getParameters(self) -> SecureRandomParameters: ...
    def getProvider(self) -> Provider: ...
    @staticmethod
    def getSeed(numBytes: int | java.jint | java.lang.Integer, /) -> java.chaquopy.JavaArrayJByte: ...
    def next(self, numBits: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def nextBytes(self, bytes: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def nextBytes(self, bytes: java.chaquopy.JavaArrayJByte, params: SecureRandomParameters, /) -> None: ...
    @typing.overload
    def reseed(self) -> None: ...
    @typing.overload
    def reseed(self, params: SecureRandomParameters, /) -> None: ...
    @typing.overload
    def setSeed(self, seed: int | java.jlong | java.lang.Long, /) -> None: ...
    @typing.overload
    def setSeed(self, seed: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def toString(self) -> str: ...

class SecureRandomParameters(java.lang.Object): ...

class SecureRandomSpi(java.io.Serializable):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, params: SecureRandomParameters, /) -> None: ...
    def engineGenerateSeed(self, arg1: int | java.jint | java.lang.Integer, /) -> java.chaquopy.JavaArrayJByte: ...
    def engineGetParameters(self) -> SecureRandomParameters: ...
    @typing.overload
    def engineNextBytes(self, arg1: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def engineNextBytes(self, bytes: java.chaquopy.JavaArrayJByte, params: SecureRandomParameters, /) -> None: ...
    def engineReseed(self, params: SecureRandomParameters, /) -> None: ...
    def engineSetSeed(self, arg1: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def toString(self) -> str: ...

class Security(java.lang.Object):
    @staticmethod
    def addProvider(provider: Provider, /) -> int: ...
    @staticmethod
    def getAlgorithmProperty(algName: str | java.lang.String, propName: str | java.lang.String, /) -> str: ...
    @staticmethod
    def getAlgorithms(serviceName: str | java.lang.String, /) -> java.util.Set[java.lang.String]: ...
    @staticmethod
    def getProperty(key: str | java.lang.String, /) -> str: ...
    @staticmethod
    def getProvider(name: str | java.lang.String, /) -> Provider: ...
    @typing.overload
    @staticmethod
    def getProviders() -> java.chaquopy.JavaArray[Provider]: ...
    @typing.overload
    @staticmethod
    def getProviders(filter: str | java.lang.String, /) -> java.chaquopy.JavaArray[Provider]: ...
    @typing.overload
    @staticmethod
    def getProviders(filter: java.util.Map[java.lang.String, java.lang.String], /) -> java.chaquopy.JavaArray[Provider]: ...
    @staticmethod
    def insertProviderAt(provider: Provider, position: int | java.jint | java.lang.Integer, /) -> int: ...
    @staticmethod
    def removeProvider(name: str | java.lang.String, /) -> None: ...
    @staticmethod
    def setProperty(key: str | java.lang.String, datum: str | java.lang.String, /) -> None: ...

class SecurityPermission(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 Signature(SignatureSpi):
    SIGN: typing.ClassVar[int] = ...
    UNINITIALIZED: typing.ClassVar[int] = ...
    VERIFY: typing.ClassVar[int] = ...
    state: int = ...
    def __init__(self, algorithm: str | java.lang.String, /) -> None: ...
    def clone(self) -> java.lang.Object: ...
    def getAlgorithm(self) -> str: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, /) -> Signature: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: str | java.lang.String, /) -> Signature: ...
    @typing.overload
    @staticmethod
    def getInstance(algorithm: str | java.lang.String, provider: Provider, /) -> Signature: ...
    def getParameter(self, param: str | java.lang.String, /) -> java.lang.Object: ...
    def getParameters(self) -> AlgorithmParameters: ...
    def getProvider(self) -> Provider: ...
    @typing.overload
    def initSign(self, privateKey: PrivateKey, /) -> None: ...
    @typing.overload
    def initSign(self, privateKey: PrivateKey, random: SecureRandom, /) -> None: ...
    @typing.overload
    def initVerify(self, publicKey: PublicKey, /) -> None: ...
    @typing.overload
    def initVerify(self, certificate: java.security.cert.Certificate, /) -> None: ...
    @typing.overload
    def setParameter(self, params: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def setParameter(self, param: str | java.lang.String, value: java.lang.Object | int | bool | float | str, /) -> None: ...
    @typing.overload
    def sign(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def sign(self, outbuf: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> int: ...
    def toString(self) -> str: ...
    @typing.overload
    def update(self, b: int | java.jbyte | java.lang.Byte, /) -> None: ...
    @typing.overload
    def update(self, data: java.nio.ByteBuffer, /) -> None: ...
    @typing.overload
    def update(self, data: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def update(self, data: java.chaquopy.JavaArrayJByte, off: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def verify(self, signature: java.chaquopy.JavaArrayJByte, /) -> bool: ...
    @typing.overload
    def verify(self, signature: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, length: int | java.jint | java.lang.Integer, /) -> bool: ...

class SignatureException(GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, cause: java.lang.Throwable, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

class SignatureSpi(java.lang.Object):
    appRandom: SecureRandom = ...
    def __init__(self) -> None: ...
    def clone(self) -> java.lang.Object: ...
    def engineGetParameter(self, arg1: str | java.lang.String, /) -> java.lang.Object: ...
    def engineGetParameters(self) -> AlgorithmParameters: ...
    @typing.overload
    def engineInitSign(self, arg1: PrivateKey, /) -> None: ...
    @typing.overload
    def engineInitSign(self, privateKey: PrivateKey, random: SecureRandom, /) -> None: ...
    def engineInitVerify(self, arg1: PublicKey, /) -> None: ...
    @typing.overload
    def engineSetParameter(self, params: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    @typing.overload
    def engineSetParameter(self, arg1: str | java.lang.String, arg2: java.lang.Object | int | bool | float | str, /) -> None: ...
    @typing.overload
    def engineSign(self) -> java.chaquopy.JavaArrayJByte: ...
    @typing.overload
    def engineSign(self, outbuf: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, len: int | java.jint | java.lang.Integer, /) -> int: ...
    @typing.overload
    def engineUpdate(self, arg1: int | java.jbyte | java.lang.Byte, /) -> None: ...
    @typing.overload
    def engineUpdate(self, input: java.nio.ByteBuffer, /) -> None: ...
    @typing.overload
    def engineUpdate(self, arg1: java.chaquopy.JavaArrayJByte, arg2: int | java.jint | java.lang.Integer, arg3: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def engineVerify(self, arg1: java.chaquopy.JavaArrayJByte, /) -> bool: ...
    @typing.overload
    def engineVerify(self, sigBytes: java.chaquopy.JavaArrayJByte, offset: int | java.jint | java.lang.Integer, length: int | java.jint | java.lang.Integer, /) -> bool: ...

class SignedObject(java.io.Serializable):
    def __init__(self, object: java.io.Serializable, signingKey: PrivateKey, signingEngine: Signature, /) -> None: ...
    def getAlgorithm(self) -> str: ...
    def getObject(self) -> java.lang.Object: ...
    def getSignature(self) -> java.chaquopy.JavaArrayJByte: ...
    def verify(self, verificationKey: PublicKey, verificationEngine: Signature, /) -> bool: ...

class Signer(Identity):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, name: str | java.lang.String, scope: IdentityScope, /) -> None: ...
    def getPrivateKey(self) -> PrivateKey: ...
    def setKeyPair(self, pair: KeyPair, /) -> None: ...
    def toString(self) -> str: ...

class Timestamp(java.io.Serializable):
    def __init__(self, timestamp: java.util.Date, signerCertPath: java.security.cert.CertPath, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getSignerCertPath(self) -> java.security.cert.CertPath: ...
    def getTimestamp(self) -> java.util.Date: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...

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

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

class UnresolvedPermission(Permission, java.io.Serializable):
    def __init__(self, type: str | java.lang.String, name: str | java.lang.String, actions: str | java.lang.String, certs: java.chaquopy.JavaArray[java.security.cert.Certificate], /) -> None: ...
    def getActions(self) -> str: ...
    def getUnresolvedActions(self) -> str: ...
    def getUnresolvedCerts(self) -> java.chaquopy.JavaArray[java.security.cert.Certificate]: ...
    def getUnresolvedName(self) -> str: ...
    def getUnresolvedType(self) -> str: ...
    def implies(self, p: Permission, /) -> bool: ...
