import typing

import android.content
import android.net
import android.net.eap
import android.net.ipsec.ike.exceptions
import android.util
import java
import java.chaquopy
import java.io
import java.lang
import java.net
import java.security
import java.security.cert
import java.util
import java.util.concurrent
import javax.security.auth.x500

class ChildSaProposal(SaProposal):
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    @staticmethod
    def getSupportedEncryptionAlgorithms() -> java.util.Set[java.lang.Integer]: ...
    @staticmethod
    def getSupportedIntegrityAlgorithms() -> java.util.Set[java.lang.Integer]: ...
    def hashCode(self) -> int: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def addDhGroup(self, dhGroup: int | java.jint | java.lang.Integer, /) -> ChildSaProposal.Builder: ...
        def addEncryptionAlgorithm(self, algorithm: int | java.jint | java.lang.Integer, keyLength: int | java.jint | java.lang.Integer, /) -> ChildSaProposal.Builder: ...
        def addIntegrityAlgorithm(self, algorithm: int | java.jint | java.lang.Integer, /) -> ChildSaProposal.Builder: ...
        def build(self) -> ChildSaProposal: ...

class ChildSessionCallback(java.lang.Object):
    def onClosed(self) -> None: ...
    def onClosedWithException(self, exception: android.net.ipsec.ike.exceptions.IkeException, /) -> None: ...
    def onIpSecTransformCreated(self, arg1: android.net.IpSecTransform, arg2: int | java.jint | java.lang.Integer, /) -> None: ...
    def onIpSecTransformDeleted(self, arg1: android.net.IpSecTransform, arg2: int | java.jint | java.lang.Integer, /) -> None: ...
    def onOpened(self, arg1: ChildSessionConfiguration, /) -> None: ...

class ChildSessionConfiguration(java.lang.Object):
    def getInboundTrafficSelectors(self) -> java.util.List[IkeTrafficSelector]: ...
    def getOutboundTrafficSelectors(self) -> java.util.List[IkeTrafficSelector]: ...

    class Builder(java.lang.Object):
        def __init__(self, inTs: java.util.List[IkeTrafficSelector], outTs: java.util.List[IkeTrafficSelector], /) -> None: ...
        def build(self) -> ChildSessionConfiguration: ...

class ChildSessionParams(java.lang.Object):
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getChildSaProposals(self) -> java.util.List[ChildSaProposal]: ...
    def getHardLifetimeSeconds(self) -> int: ...
    def getInboundTrafficSelectors(self) -> java.util.List[IkeTrafficSelector]: ...
    def getOutboundTrafficSelectors(self) -> java.util.List[IkeTrafficSelector]: ...
    def getSoftLifetimeSeconds(self) -> int: ...
    def hashCode(self) -> int: ...

class IkeDerAsn1DnIdentification(IkeIdentification):
    derAsn1Dn: javax.security.auth.x500.X500Principal = ...
    def __init__(self, derAsn1Dn: javax.security.auth.x500.X500Principal, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeFqdnIdentification(IkeIdentification):
    fqdn: str = ...
    def __init__(self, fqdn: str | java.lang.String, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

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

class IkeIpv4AddrIdentification(IkeIdentification):
    ipv4Address: java.net.Inet4Address = ...
    def __init__(self, address: java.net.Inet4Address, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeIpv6AddrIdentification(IkeIdentification):
    ipv6Address: java.net.Inet6Address = ...
    def __init__(self, address: java.net.Inet6Address, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeKeyIdIdentification(IkeIdentification):
    keyId: java.chaquopy.JavaArrayJByte = ...
    def __init__(self, keyId: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeRfc822AddrIdentification(IkeIdentification):
    rfc822Name: str = ...
    def __init__(self, rfc822Name: str | java.lang.String, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeSaProposal(SaProposal):
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getPseudorandomFunctions(self) -> java.util.List[java.lang.Integer]: ...
    @staticmethod
    def getSupportedEncryptionAlgorithms() -> java.util.Set[java.lang.Integer]: ...
    @staticmethod
    def getSupportedIntegrityAlgorithms() -> java.util.Set[java.lang.Integer]: ...
    @staticmethod
    def getSupportedPseudorandomFunctions() -> java.util.Set[java.lang.Integer]: ...
    def hashCode(self) -> int: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def addDhGroup(self, dhGroup: int | java.jint | java.lang.Integer, /) -> IkeSaProposal.Builder: ...
        def addEncryptionAlgorithm(self, algorithm: int | java.jint | java.lang.Integer, keyLength: int | java.jint | java.lang.Integer, /) -> IkeSaProposal.Builder: ...
        def addIntegrityAlgorithm(self, algorithm: int | java.jint | java.lang.Integer, /) -> IkeSaProposal.Builder: ...
        def addPseudorandomFunction(self, algorithm: int | java.jint | java.lang.Integer, /) -> IkeSaProposal.Builder: ...
        def build(self) -> IkeSaProposal: ...

class IkeSession(java.lang.AutoCloseable):
    def __init__(self, context: android.content.Context, ikeSessionParams: IkeSessionParams, firstChildSessionParams: ChildSessionParams, userCbExecutor: java.util.concurrent.Executor, ikeSessionCallback: IkeSessionCallback, firstChildSessionCallback: ChildSessionCallback, /) -> None: ...
    def close(self) -> None: ...
    def closeChildSession(self, childSessionCallback: ChildSessionCallback, /) -> None: ...
    def dump(self, pw: java.io.PrintWriter, /) -> None: ...
    def finalize(self) -> None: ...
    def kill(self) -> None: ...
    def openChildSession(self, childSessionParams: ChildSessionParams, childSessionCallback: ChildSessionCallback, /) -> None: ...

class IkeSessionCallback(java.lang.Object):
    def onClosed(self) -> None: ...
    def onClosedWithException(self, exception: android.net.ipsec.ike.exceptions.IkeException, /) -> None: ...
    def onError(self, exception: android.net.ipsec.ike.exceptions.IkeException, /) -> None: ...
    def onOpened(self, arg1: IkeSessionConfiguration, /) -> None: ...

class IkeSessionConfiguration(java.lang.Object):
    EXTENSION_TYPE_FRAGMENTATION: typing.ClassVar[int] = ...
    EXTENSION_TYPE_MOBIKE: typing.ClassVar[int] = ...
    def getEapInfo(self) -> android.net.eap.EapInfo | None: ...
    def getIkeSessionConnectionInfo(self) -> IkeSessionConnectionInfo: ...
    def getRemoteApplicationVersion(self) -> str: ...
    def getRemoteVendorIds(self) -> java.util.List[java.chaquopy.JavaArrayJByte]: ...
    def isIkeExtensionEnabled(self, extensionType: int | java.jint | java.lang.Integer, /) -> bool: ...

    class Builder(java.lang.Object):
        def __init__(self, ikeConnInfo: IkeSessionConnectionInfo, /) -> None: ...
        def addIkeExtension(self, extensionType: int | java.jint | java.lang.Integer, /) -> IkeSessionConfiguration.Builder: ...
        def addRemoteVendorId(self, remoteVendorId: java.chaquopy.JavaArrayJByte, /) -> IkeSessionConfiguration.Builder: ...
        def build(self) -> IkeSessionConfiguration: ...
        def clearIkeExtensions(self) -> IkeSessionConfiguration.Builder: ...
        def clearRemoteApplicationVersion(self) -> IkeSessionConfiguration.Builder: ...
        def clearRemoteVendorIds(self) -> IkeSessionConfiguration.Builder: ...
        def setEapInfo(self, eapInfo: android.net.eap.EapInfo, /) -> IkeSessionConfiguration.Builder: ...
        def setRemoteApplicationVersion(self, remoteApplicationVersion: str | java.lang.String, /) -> IkeSessionConfiguration.Builder: ...

class IkeSessionConnectionInfo(java.lang.Object):
    def __init__(self, localAddress: java.net.InetAddress, remoteAddress: java.net.InetAddress, network: android.net.Network, /) -> None: ...
    def getLocalAddress(self) -> java.net.InetAddress: ...
    def getNetwork(self) -> android.net.Network: ...
    def getRemoteAddress(self) -> java.net.InetAddress: ...

class IkeSessionParams(java.lang.Object):
    IKE_DPD_DELAY_SEC_DISABLED: typing.ClassVar[int] = ...
    IKE_OPTION_ACCEPT_ANY_REMOTE_ID: typing.ClassVar[int] = ...
    IKE_OPTION_EAP_ONLY_AUTH: typing.ClassVar[int] = ...
    IKE_OPTION_FORCE_PORT_4500: typing.ClassVar[int] = ...
    IKE_OPTION_INITIAL_CONTACT: typing.ClassVar[int] = ...
    IKE_OPTION_MOBIKE: typing.ClassVar[int] = ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getDpdDelaySeconds(self) -> int: ...
    def getHardLifetimeSeconds(self) -> int: ...
    def getIkeOptions(self) -> java.util.Set[java.lang.Integer]: ...
    def getIkeSaProposals(self) -> java.util.List[IkeSaProposal]: ...
    def getLocalAuthConfig(self) -> IkeSessionParams.IkeAuthConfig: ...
    def getLocalIdentification(self) -> IkeIdentification: ...
    def getNattKeepAliveDelaySeconds(self) -> int: ...
    def getNetwork(self) -> android.net.Network | None: ...
    def getRemoteAuthConfig(self) -> IkeSessionParams.IkeAuthConfig: ...
    def getRemoteIdentification(self) -> IkeIdentification: ...
    def getRetransmissionTimeoutsMillis(self) -> java.chaquopy.JavaArrayJInt: ...
    def getServerHostname(self) -> str: ...
    def getSoftLifetimeSeconds(self) -> int: ...
    def hasIkeOption(self, ikeOption: int | java.jint | java.lang.Integer, /) -> bool: ...
    def hashCode(self) -> int: ...

    class IkeAuthPskConfig(IkeSessionParams.IkeAuthConfig):
        def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def getPsk(self) -> java.chaquopy.JavaArrayJByte: ...
        def hashCode(self) -> int: ...

    class IkeAuthEapConfig(IkeSessionParams.IkeAuthConfig):
        def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def getEapConfig(self) -> android.net.eap.EapSessionConfig: ...
        def hashCode(self) -> int: ...

    class IkeAuthDigitalSignRemoteConfig(IkeSessionParams.IkeAuthConfig):
        def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def getRemoteCaCert(self) -> java.security.cert.X509Certificate: ...
        def hashCode(self) -> int: ...

    class IkeAuthDigitalSignLocalConfig(IkeSessionParams.IkeAuthConfig):
        def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def getClientEndCertificate(self) -> java.security.cert.X509Certificate: ...
        def getIntermediateCertificates(self) -> java.util.List[java.security.cert.X509Certificate]: ...
        def getPrivateKey(self) -> java.security.PrivateKey: ...
        def hashCode(self) -> int: ...

    class IkeAuthConfig(java.lang.Object):
        def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
        def hashCode(self) -> int: ...

    class Builder(java.lang.Object):
        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, ikeSessionParams: IkeSessionParams, /) -> None: ...
        def addIkeOption(self, ikeOption: int | java.jint | java.lang.Integer, /) -> IkeSessionParams.Builder: ...
        def addIkeSaProposal(self, proposal: IkeSaProposal, /) -> IkeSessionParams.Builder: ...
        def build(self) -> IkeSessionParams: ...
        def removeIkeOption(self, ikeOption: int | java.jint | java.lang.Integer, /) -> IkeSessionParams.Builder: ...
        @typing.overload
        def setAuthDigitalSignature(self, serverCaCert: java.security.cert.X509Certificate, clientEndCert: java.security.cert.X509Certificate, clientPrivateKey: java.security.PrivateKey, /) -> IkeSessionParams.Builder: ...
        @typing.overload
        def setAuthDigitalSignature(self, serverCaCert: java.security.cert.X509Certificate, clientEndCert: java.security.cert.X509Certificate, clientIntermediateCerts: java.util.List[java.security.cert.X509Certificate], clientPrivateKey: java.security.PrivateKey, /) -> IkeSessionParams.Builder: ...
        def setAuthEap(self, serverCaCert: java.security.cert.X509Certificate, eapConfig: android.net.eap.EapSessionConfig, /) -> IkeSessionParams.Builder: ...
        def setAuthPsk(self, sharedKey: java.chaquopy.JavaArrayJByte, /) -> IkeSessionParams.Builder: ...
        def setDpdDelaySeconds(self, dpdDelaySeconds: int | java.jint | java.lang.Integer, /) -> IkeSessionParams.Builder: ...
        def setLifetimeSeconds(self, hardLifetimeSeconds: int | java.jint | java.lang.Integer, softLifetimeSeconds: int | java.jint | java.lang.Integer, /) -> IkeSessionParams.Builder: ...
        def setLocalIdentification(self, identification: IkeIdentification, /) -> IkeSessionParams.Builder: ...
        def setNattKeepAliveDelaySeconds(self, nattKeepaliveDelaySeconds: int | java.jint | java.lang.Integer, /) -> IkeSessionParams.Builder: ...
        def setNetwork(self, network: android.net.Network, /) -> IkeSessionParams.Builder: ...
        def setRemoteIdentification(self, identification: IkeIdentification, /) -> IkeSessionParams.Builder: ...
        def setRetransmissionTimeoutsMillis(self, retransTimeoutMillisList: java.chaquopy.JavaArrayJInt, /) -> IkeSessionParams.Builder: ...
        def setServerHostname(self, serverHostname: str | java.lang.String, /) -> IkeSessionParams.Builder: ...

class IkeTrafficSelector(java.lang.Object):
    endPort: int = ...
    endingAddress: java.net.InetAddress = ...
    startPort: int = ...
    startingAddress: java.net.InetAddress = ...
    def __init__(self, startPort: int | java.jint | java.lang.Integer, endPort: int | java.jint | java.lang.Integer, startingAddress: java.net.InetAddress, endingAddress: java.net.InetAddress, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def hashCode(self) -> int: ...

class IkeTunnelConnectionParams(java.lang.Object):
    def __init__(self, ikeParams: IkeSessionParams, childParams: TunnelModeChildSessionParams, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getIkeSessionParams(self) -> IkeSessionParams: ...
    def getTunnelModeChildSessionParams(self) -> TunnelModeChildSessionParams: ...
    def hashCode(self) -> int: ...

class SaProposal(java.lang.Object):
    DH_GROUP_1024_BIT_MODP: typing.ClassVar[int] = ...
    DH_GROUP_1536_BIT_MODP: typing.ClassVar[int] = ...
    DH_GROUP_2048_BIT_MODP: typing.ClassVar[int] = ...
    DH_GROUP_3072_BIT_MODP: typing.ClassVar[int] = ...
    DH_GROUP_4096_BIT_MODP: typing.ClassVar[int] = ...
    DH_GROUP_CURVE_25519: typing.ClassVar[int] = ...
    DH_GROUP_NONE: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_3DES: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_AES_CBC: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_AES_CTR: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_AES_GCM_12: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_AES_GCM_16: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_AES_GCM_8: typing.ClassVar[int] = ...
    ENCRYPTION_ALGORITHM_CHACHA20_POLY1305: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_AES_CMAC_96: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_AES_XCBC_96: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_HMAC_SHA1_96: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_HMAC_SHA2_256_128: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_HMAC_SHA2_384_192: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_HMAC_SHA2_512_256: typing.ClassVar[int] = ...
    INTEGRITY_ALGORITHM_NONE: typing.ClassVar[int] = ...
    KEY_LEN_AES_128: typing.ClassVar[int] = ...
    KEY_LEN_AES_192: typing.ClassVar[int] = ...
    KEY_LEN_AES_256: typing.ClassVar[int] = ...
    KEY_LEN_UNUSED: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_AES128_CMAC: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_AES128_XCBC: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_HMAC_SHA1: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_SHA2_256: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_SHA2_384: typing.ClassVar[int] = ...
    PSEUDORANDOM_FUNCTION_SHA2_512: typing.ClassVar[int] = ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getDhGroups(self) -> java.util.List[java.lang.Integer]: ...
    def getEncryptionAlgorithms(self) -> java.util.List[android.util.Pair[java.lang.Integer, java.lang.Integer]]: ...
    def getIntegrityAlgorithms(self) -> java.util.List[java.lang.Integer]: ...
    @staticmethod
    def getSupportedDhGroups() -> java.util.Set[java.lang.Integer]: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...

class TransportModeChildSessionParams(ChildSessionParams):

    class Builder(java.lang.Object):
        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, childParams: TransportModeChildSessionParams, /) -> None: ...
        def addChildSaProposal(self, proposal: ChildSaProposal, /) -> TransportModeChildSessionParams.Builder: ...
        def addInboundTrafficSelectors(self, trafficSelector: IkeTrafficSelector, /) -> TransportModeChildSessionParams.Builder: ...
        def addOutboundTrafficSelectors(self, trafficSelector: IkeTrafficSelector, /) -> TransportModeChildSessionParams.Builder: ...
        def build(self) -> TransportModeChildSessionParams: ...
        def setLifetimeSeconds(self, hardLifetimeSeconds: int | java.jint | java.lang.Integer, softLifetimeSeconds: int | java.jint | java.lang.Integer, /) -> TransportModeChildSessionParams.Builder: ...

class TunnelModeChildSessionParams(ChildSessionParams):
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getConfigurationRequests(self) -> java.util.List[TunnelModeChildSessionParams.TunnelModeChildConfigRequest]: ...
    def hashCode(self) -> int: ...

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

    class ConfigRequestIpv6DnsServer(TunnelModeChildSessionParams.TunnelModeChildConfigRequest): ...

    class ConfigRequestIpv6Address(TunnelModeChildSessionParams.TunnelModeChildConfigRequest):
        def getAddress(self) -> java.net.Inet6Address: ...
        def getPrefixLength(self) -> int: ...

    class ConfigRequestIpv4Netmask(TunnelModeChildSessionParams.TunnelModeChildConfigRequest): ...

    class ConfigRequestIpv4DnsServer(TunnelModeChildSessionParams.TunnelModeChildConfigRequest): ...

    class ConfigRequestIpv4DhcpServer(TunnelModeChildSessionParams.TunnelModeChildConfigRequest): ...

    class ConfigRequestIpv4Address(TunnelModeChildSessionParams.TunnelModeChildConfigRequest):
        def getAddress(self) -> java.net.Inet4Address: ...

    class Builder(java.lang.Object):
        @typing.overload
        def __init__(self) -> None: ...
        @typing.overload
        def __init__(self, childParams: TunnelModeChildSessionParams, /) -> None: ...
        def addChildSaProposal(self, proposal: ChildSaProposal, /) -> TunnelModeChildSessionParams.Builder: ...
        def addInboundTrafficSelectors(self, trafficSelector: IkeTrafficSelector, /) -> TunnelModeChildSessionParams.Builder: ...
        @typing.overload
        def addInternalAddressRequest(self, addressFamily: int | java.jint | java.lang.Integer, /) -> TunnelModeChildSessionParams.Builder: ...
        @typing.overload
        def addInternalAddressRequest(self, address: java.net.Inet4Address, /) -> TunnelModeChildSessionParams.Builder: ...
        @typing.overload
        def addInternalAddressRequest(self, address: java.net.Inet6Address, prefixLen: int | java.jint | java.lang.Integer, /) -> TunnelModeChildSessionParams.Builder: ...
        def addInternalDhcpServerRequest(self, addressFamily: int | java.jint | java.lang.Integer, /) -> TunnelModeChildSessionParams.Builder: ...
        def addInternalDnsServerRequest(self, addressFamily: int | java.jint | java.lang.Integer, /) -> TunnelModeChildSessionParams.Builder: ...
        def addOutboundTrafficSelectors(self, trafficSelector: IkeTrafficSelector, /) -> TunnelModeChildSessionParams.Builder: ...
        def build(self) -> TunnelModeChildSessionParams: ...
        def setLifetimeSeconds(self, hardLifetimeSeconds: int | java.jint | java.lang.Integer, softLifetimeSeconds: int | java.jint | java.lang.Integer, /) -> TunnelModeChildSessionParams.Builder: ...
