import typing

import android.net
import java
import java.chaquopy
import java.io
import java.lang

class IkeException(java.lang.Exception): ...

class IkeIOException(IkeNonProtocolException):
    def __init__(self, cause: java.io.IOException, /) -> None: ...
    def getCause(self) -> java.io.IOException: ...
    def initCause(self, cause: java.lang.Throwable, /) -> java.lang.Throwable: ...

class IkeInternalException(IkeNonProtocolException):
    @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 IkeNetworkLostException(IkeNonProtocolException):
    def __init__(self, network: android.net.Network, /) -> None: ...
    def getNetwork(self) -> android.net.Network: ...

class IkeNonProtocolException(IkeException): ...

class IkeProtocolException(IkeException):
    ERROR_TYPE_AUTHENTICATION_FAILED: typing.ClassVar[int] = ...
    ERROR_TYPE_CHILD_SA_NOT_FOUND: typing.ClassVar[int] = ...
    ERROR_TYPE_FAILED_CP_REQUIRED: typing.ClassVar[int] = ...
    ERROR_TYPE_INTERNAL_ADDRESS_FAILURE: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_IKE_SPI: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_KE_PAYLOAD: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_MAJOR_VERSION: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_MESSAGE_ID: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_SELECTORS: typing.ClassVar[int] = ...
    ERROR_TYPE_INVALID_SYNTAX: typing.ClassVar[int] = ...
    ERROR_TYPE_NO_ADDITIONAL_SAS: typing.ClassVar[int] = ...
    ERROR_TYPE_NO_PROPOSAL_CHOSEN: typing.ClassVar[int] = ...
    ERROR_TYPE_SINGLE_PAIR_REQUIRED: typing.ClassVar[int] = ...
    ERROR_TYPE_TEMPORARY_FAILURE: typing.ClassVar[int] = ...
    ERROR_TYPE_TS_UNACCEPTABLE: typing.ClassVar[int] = ...
    ERROR_TYPE_UNSUPPORTED_CRITICAL_PAYLOAD: typing.ClassVar[int] = ...
    def getErrorType(self) -> int: ...

class IkeTimeoutException(java.io.IOException):
    def __init__(self, message: str | java.lang.String, /) -> None: ...

class InvalidKeException(IkeProtocolException):
    def __init__(self, dhGroup: int | java.jint | java.lang.Integer, /) -> None: ...
    def getDhGroup(self) -> int: ...

class InvalidMajorVersionException(IkeProtocolException):
    def __init__(self, version: int | java.jbyte | java.lang.Byte, /) -> None: ...
    def getMajorVersion(self) -> int: ...

class InvalidSelectorsException(IkeProtocolException):
    def __init__(self, spi: int | java.jint | java.lang.Integer, packetInfo: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def getIpSecPacketInfo(self) -> java.chaquopy.JavaArrayJByte: ...
    def getIpSecSpi(self) -> int: ...
