import typing

import java
import java.chaquopy
import java.lang
import java.math
import java.security
import java.security.interfaces
import java.util

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

class DSAGenParameterSpec(AlgorithmParameterSpec):
    @typing.overload
    def __init__(self, primePLen: int | java.jint | java.lang.Integer, subprimeQLen: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def __init__(self, primePLen: int | java.jint | java.lang.Integer, subprimeQLen: int | java.jint | java.lang.Integer, seedLen: int | java.jint | java.lang.Integer, /) -> None: ...
    def getPrimePLength(self) -> int: ...
    def getSeedLength(self) -> int: ...
    def getSubprimeQLength(self) -> int: ...

class DSAParameterSpec(AlgorithmParameterSpec, java.security.interfaces.DSAParams):
    def __init__(self, p: java.math.BigInteger, q: java.math.BigInteger, g: java.math.BigInteger, /) -> None: ...
    def getG(self) -> java.math.BigInteger: ...
    def getP(self) -> java.math.BigInteger: ...
    def getQ(self) -> java.math.BigInteger: ...

class DSAPrivateKeySpec(KeySpec):
    def __init__(self, x: java.math.BigInteger, p: java.math.BigInteger, q: java.math.BigInteger, g: java.math.BigInteger, /) -> None: ...
    def getG(self) -> java.math.BigInteger: ...
    def getP(self) -> java.math.BigInteger: ...
    def getQ(self) -> java.math.BigInteger: ...
    def getX(self) -> java.math.BigInteger: ...

class DSAPublicKeySpec(KeySpec):
    def __init__(self, y: java.math.BigInteger, p: java.math.BigInteger, q: java.math.BigInteger, g: java.math.BigInteger, /) -> None: ...
    def getG(self) -> java.math.BigInteger: ...
    def getP(self) -> java.math.BigInteger: ...
    def getQ(self) -> java.math.BigInteger: ...
    def getY(self) -> java.math.BigInteger: ...

class ECField(java.lang.Object):
    def getFieldSize(self) -> int: ...

class ECFieldF2m(ECField):
    @typing.overload
    def __init__(self, m: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def __init__(self, m: int | java.jint | java.lang.Integer, rp: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, m: int | java.jint | java.lang.Integer, ks: java.chaquopy.JavaArrayJInt, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getFieldSize(self) -> int: ...
    def getM(self) -> int: ...
    def getMidTermsOfReductionPolynomial(self) -> java.chaquopy.JavaArrayJInt: ...
    def getReductionPolynomial(self) -> java.math.BigInteger: ...
    def hashCode(self) -> int: ...

class ECFieldFp(ECField):
    def __init__(self, p: java.math.BigInteger, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getFieldSize(self) -> int: ...
    def getP(self) -> java.math.BigInteger: ...
    def hashCode(self) -> int: ...

class ECGenParameterSpec(NamedParameterSpec, AlgorithmParameterSpec):
    def __init__(self, stdName: str | java.lang.String, /) -> None: ...
    def getName(self) -> str: ...

class ECParameterSpec(AlgorithmParameterSpec):
    def __init__(self, curve: EllipticCurve, g: ECPoint, n: java.math.BigInteger, h: int | java.jint | java.lang.Integer, /) -> None: ...
    def getCofactor(self) -> int: ...
    def getCurve(self) -> EllipticCurve: ...
    def getGenerator(self) -> ECPoint: ...
    def getOrder(self) -> java.math.BigInteger: ...

class ECPoint(java.lang.Object):
    POINT_INFINITY: typing.ClassVar[ECPoint] = ...
    def __init__(self, x: java.math.BigInteger, y: java.math.BigInteger, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getAffineX(self) -> java.math.BigInteger: ...
    def getAffineY(self) -> java.math.BigInteger: ...
    def hashCode(self) -> int: ...

class ECPrivateKeySpec(KeySpec):
    def __init__(self, s: java.math.BigInteger, params: ECParameterSpec, /) -> None: ...
    def getParams(self) -> ECParameterSpec: ...
    def getS(self) -> java.math.BigInteger: ...

class ECPublicKeySpec(KeySpec):
    def __init__(self, w: ECPoint, params: ECParameterSpec, /) -> None: ...
    def getParams(self) -> ECParameterSpec: ...
    def getW(self) -> ECPoint: ...

class EdDSAParameterSpec(AlgorithmParameterSpec):
    @typing.overload
    def __init__(self, prehash: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    @typing.overload
    def __init__(self, prehash: bool | java.jboolean | java.lang.Boolean, context: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def getContext(self) -> java.util.Optional[java.chaquopy.JavaArrayJByte]: ...
    def isPrehash(self) -> bool: ...

class EdECPoint(java.lang.Object):
    def __init__(self, xOdd: bool | java.jboolean | java.lang.Boolean, y: java.math.BigInteger, /) -> None: ...
    def getY(self) -> java.math.BigInteger: ...
    def isXOdd(self) -> bool: ...

class EdECPrivateKeySpec(KeySpec):
    def __init__(self, params: NamedParameterSpec, bytes: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def getBytes(self) -> java.chaquopy.JavaArrayJByte: ...
    def getParams(self) -> NamedParameterSpec: ...

class EdECPublicKeySpec(KeySpec):
    def __init__(self, params: NamedParameterSpec, point: EdECPoint, /) -> None: ...
    def getParams(self) -> NamedParameterSpec: ...
    def getPoint(self) -> EdECPoint: ...

class EllipticCurve(java.lang.Object):
    @typing.overload
    def __init__(self, field: ECField, a: java.math.BigInteger, b: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, field: ECField, a: java.math.BigInteger, b: java.math.BigInteger, seed: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def equals(self, obj: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getA(self) -> java.math.BigInteger: ...
    def getB(self) -> java.math.BigInteger: ...
    def getField(self) -> ECField: ...
    def getSeed(self) -> java.chaquopy.JavaArrayJByte: ...
    def hashCode(self) -> int: ...

class EncodedKeySpec(KeySpec):
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, algorithm: str | java.lang.String, /) -> None: ...
    def getAlgorithm(self) -> str: ...
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    def getFormat(self) -> str: ...

class InvalidKeySpecException(java.security.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 InvalidParameterSpecException(java.security.GeneralSecurityException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, msg: str | java.lang.String, /) -> None: ...

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

class MGF1ParameterSpec(AlgorithmParameterSpec):
    SHA1: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA224: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA256: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA384: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA3_224: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA3_256: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA3_384: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA3_512: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA512: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA512_224: typing.ClassVar[MGF1ParameterSpec] = ...
    SHA512_256: typing.ClassVar[MGF1ParameterSpec] = ...
    def __init__(self, mdName: str | java.lang.String, /) -> None: ...
    def getDigestAlgorithm(self) -> str: ...
    def toString(self) -> str: ...

class NamedParameterSpec(AlgorithmParameterSpec):
    ED25519: typing.ClassVar[NamedParameterSpec] = ...
    ED448: typing.ClassVar[NamedParameterSpec] = ...
    X25519: typing.ClassVar[NamedParameterSpec] = ...
    X448: typing.ClassVar[NamedParameterSpec] = ...
    def __init__(self, stdName: str | java.lang.String, /) -> None: ...
    def getName(self) -> str: ...

class PKCS8EncodedKeySpec(EncodedKeySpec):
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, algorithm: str | java.lang.String, /) -> None: ...
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    def getFormat(self) -> str: ...

class PSSParameterSpec(AlgorithmParameterSpec):
    DEFAULT: typing.ClassVar[PSSParameterSpec] = ...
    TRAILER_FIELD_BC: typing.ClassVar[int] = ...
    @typing.overload
    def __init__(self, saltLen: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def __init__(self, mdName: str | java.lang.String, mgfName: str | java.lang.String, mgfSpec: AlgorithmParameterSpec, saltLen: int | java.jint | java.lang.Integer, trailerField: int | java.jint | java.lang.Integer, /) -> None: ...
    def getDigestAlgorithm(self) -> str: ...
    def getMGFAlgorithm(self) -> str: ...
    def getMGFParameters(self) -> AlgorithmParameterSpec: ...
    def getSaltLength(self) -> int: ...
    def getTrailerField(self) -> int: ...
    def toString(self) -> str: ...

class RSAKeyGenParameterSpec(AlgorithmParameterSpec):
    F0: typing.ClassVar[java.math.BigInteger] = ...
    F4: typing.ClassVar[java.math.BigInteger] = ...
    @typing.overload
    def __init__(self, keysize: int | java.jint | java.lang.Integer, publicExponent: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, keysize: int | java.jint | java.lang.Integer, publicExponent: java.math.BigInteger, keyParams: AlgorithmParameterSpec, /) -> None: ...
    def getKeyParams(self) -> AlgorithmParameterSpec: ...
    def getKeysize(self) -> int: ...
    def getPublicExponent(self) -> java.math.BigInteger: ...

class RSAMultiPrimePrivateCrtKeySpec(RSAPrivateKeySpec):
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, privateExponent: java.math.BigInteger, primeP: java.math.BigInteger, primeQ: java.math.BigInteger, primeExponentP: java.math.BigInteger, primeExponentQ: java.math.BigInteger, crtCoefficient: java.math.BigInteger, otherPrimeInfo: java.chaquopy.JavaArray[RSAOtherPrimeInfo], /) -> None: ...
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, privateExponent: java.math.BigInteger, primeP: java.math.BigInteger, primeQ: java.math.BigInteger, primeExponentP: java.math.BigInteger, primeExponentQ: java.math.BigInteger, crtCoefficient: java.math.BigInteger, otherPrimeInfo: java.chaquopy.JavaArray[RSAOtherPrimeInfo], keyParams: AlgorithmParameterSpec, /) -> None: ...
    def getCrtCoefficient(self) -> java.math.BigInteger: ...
    def getOtherPrimeInfo(self) -> java.chaquopy.JavaArray[RSAOtherPrimeInfo]: ...
    def getPrimeExponentP(self) -> java.math.BigInteger: ...
    def getPrimeExponentQ(self) -> java.math.BigInteger: ...
    def getPrimeP(self) -> java.math.BigInteger: ...
    def getPrimeQ(self) -> java.math.BigInteger: ...
    def getPublicExponent(self) -> java.math.BigInteger: ...

class RSAOtherPrimeInfo(java.lang.Object):
    def __init__(self, prime: java.math.BigInteger, primeExponent: java.math.BigInteger, crtCoefficient: java.math.BigInteger, /) -> None: ...
    def getCrtCoefficient(self) -> java.math.BigInteger: ...
    def getExponent(self) -> java.math.BigInteger: ...
    def getPrime(self) -> java.math.BigInteger: ...

class RSAPrivateCrtKeySpec(RSAPrivateKeySpec):
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, privateExponent: java.math.BigInteger, primeP: java.math.BigInteger, primeQ: java.math.BigInteger, primeExponentP: java.math.BigInteger, primeExponentQ: java.math.BigInteger, crtCoefficient: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, privateExponent: java.math.BigInteger, primeP: java.math.BigInteger, primeQ: java.math.BigInteger, primeExponentP: java.math.BigInteger, primeExponentQ: java.math.BigInteger, crtCoefficient: java.math.BigInteger, keyParams: AlgorithmParameterSpec, /) -> None: ...
    def getCrtCoefficient(self) -> java.math.BigInteger: ...
    def getPrimeExponentP(self) -> java.math.BigInteger: ...
    def getPrimeExponentQ(self) -> java.math.BigInteger: ...
    def getPrimeP(self) -> java.math.BigInteger: ...
    def getPrimeQ(self) -> java.math.BigInteger: ...
    def getPublicExponent(self) -> java.math.BigInteger: ...

class RSAPrivateKeySpec(KeySpec):
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, privateExponent: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, privateExponent: java.math.BigInteger, params: AlgorithmParameterSpec, /) -> None: ...
    def getModulus(self) -> java.math.BigInteger: ...
    def getParams(self) -> AlgorithmParameterSpec: ...
    def getPrivateExponent(self) -> java.math.BigInteger: ...

class RSAPublicKeySpec(KeySpec):
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, /) -> None: ...
    @typing.overload
    def __init__(self, modulus: java.math.BigInteger, publicExponent: java.math.BigInteger, params: AlgorithmParameterSpec, /) -> None: ...
    def getModulus(self) -> java.math.BigInteger: ...
    def getParams(self) -> AlgorithmParameterSpec: ...
    def getPublicExponent(self) -> java.math.BigInteger: ...

class X509EncodedKeySpec(EncodedKeySpec):
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, /) -> None: ...
    @typing.overload
    def __init__(self, encodedKey: java.chaquopy.JavaArrayJByte, algorithm: str | java.lang.String, /) -> None: ...
    def getEncoded(self) -> java.chaquopy.JavaArrayJByte: ...
    def getFormat(self) -> str: ...

class XECPrivateKeySpec(KeySpec):
    def __init__(self, params: AlgorithmParameterSpec, scalar: java.chaquopy.JavaArrayJByte, /) -> None: ...
    def getParams(self) -> AlgorithmParameterSpec: ...
    def getScalar(self) -> java.chaquopy.JavaArrayJByte: ...

class XECPublicKeySpec(KeySpec):
    def __init__(self, params: AlgorithmParameterSpec, u: java.math.BigInteger, /) -> None: ...
    def getParams(self) -> AlgorithmParameterSpec: ...
    def getU(self) -> java.math.BigInteger: ...
