import typing

import java
import java.chaquopy
import java.lang
import java.math
import java.security
import java.security.cert
import java.security.spec
import java.util
import javax.security.auth.x500

class BackendBusyException(java.security.ProviderException):
    @typing.overload
    def __init__(self, backOffHintMillis: int | java.jlong | java.lang.Long, /) -> None: ...
    @typing.overload
    def __init__(self, backOffHintMillis: int | java.jlong | java.lang.Long, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, backOffHintMillis: int | java.jlong | java.lang.Long, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...
    def getBackOffHintMillis(self) -> int: ...

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

class KeyGenParameterSpec(java.security.spec.AlgorithmParameterSpec):
    def getAlgorithmParameterSpec(self) -> java.security.spec.AlgorithmParameterSpec | None: ...
    def getAttestKeyAlias(self) -> str | None: ...
    def getAttestationChallenge(self) -> java.chaquopy.JavaArrayJByte: ...
    def getBlockModes(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getCertificateNotAfter(self) -> java.util.Date: ...
    def getCertificateNotBefore(self) -> java.util.Date: ...
    def getCertificateSerialNumber(self) -> java.math.BigInteger: ...
    def getCertificateSubject(self) -> javax.security.auth.x500.X500Principal: ...
    def getDigests(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getEncryptionPaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getKeySize(self) -> int: ...
    def getKeyValidityForConsumptionEnd(self) -> java.util.Date | None: ...
    def getKeyValidityForOriginationEnd(self) -> java.util.Date | None: ...
    def getKeyValidityStart(self) -> java.util.Date | None: ...
    def getKeystoreAlias(self) -> str: ...
    def getMaxUsageCount(self) -> int: ...
    def getMgf1Digests(self) -> java.util.Set[java.lang.String]: ...
    def getPurposes(self) -> int: ...
    def getSignaturePaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getUserAuthenticationType(self) -> int: ...
    def getUserAuthenticationValidityDurationSeconds(self) -> int: ...
    def isDevicePropertiesAttestationIncluded(self) -> bool: ...
    def isDigestsSpecified(self) -> bool: ...
    def isInvalidatedByBiometricEnrollment(self) -> bool: ...
    def isMgf1DigestsSpecified(self) -> bool: ...
    def isRandomizedEncryptionRequired(self) -> bool: ...
    def isStrongBoxBacked(self) -> bool: ...
    def isUnlockedDeviceRequired(self) -> bool: ...
    def isUserAuthenticationRequired(self) -> bool: ...
    def isUserAuthenticationValidWhileOnBody(self) -> bool: ...
    def isUserConfirmationRequired(self) -> bool: ...
    def isUserPresenceRequired(self) -> bool: ...

    class Builder(java.lang.Object):
        def __init__(self, keystoreAlias: str | java.lang.String, purposes: int | java.jint | java.lang.Integer, /) -> None: ...
        def build(self) -> KeyGenParameterSpec: ...
        def setAlgorithmParameterSpec(self, spec: java.security.spec.AlgorithmParameterSpec, /) -> KeyGenParameterSpec.Builder: ...
        def setAttestKeyAlias(self, attestKeyAlias: str | java.lang.String, /) -> KeyGenParameterSpec.Builder: ...
        def setAttestationChallenge(self, attestationChallenge: java.chaquopy.JavaArrayJByte, /) -> KeyGenParameterSpec.Builder: ...
        def setBlockModes(self, *blockModes: java.lang.String) -> KeyGenParameterSpec.Builder: ...
        def setCertificateNotAfter(self, date: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setCertificateNotBefore(self, date: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setCertificateSerialNumber(self, serialNumber: java.math.BigInteger, /) -> KeyGenParameterSpec.Builder: ...
        def setCertificateSubject(self, subject: javax.security.auth.x500.X500Principal, /) -> KeyGenParameterSpec.Builder: ...
        def setDevicePropertiesAttestationIncluded(self, devicePropertiesAttestationIncluded: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setDigests(self, *digests: java.lang.String) -> KeyGenParameterSpec.Builder: ...
        def setEncryptionPaddings(self, *paddings: java.lang.String) -> KeyGenParameterSpec.Builder: ...
        def setInvalidatedByBiometricEnrollment(self, invalidateKey: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setIsStrongBoxBacked(self, isStrongBoxBacked: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setKeySize(self, keySize: int | java.jint | java.lang.Integer, /) -> KeyGenParameterSpec.Builder: ...
        def setKeyValidityEnd(self, endDate: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setKeyValidityForConsumptionEnd(self, endDate: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setKeyValidityForOriginationEnd(self, endDate: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setKeyValidityStart(self, startDate: java.util.Date, /) -> KeyGenParameterSpec.Builder: ...
        def setMaxUsageCount(self, maxUsageCount: int | java.jint | java.lang.Integer, /) -> KeyGenParameterSpec.Builder: ...
        def setMgf1Digests(self, *mgf1Digests: java.lang.String) -> KeyGenParameterSpec.Builder: ...
        def setRandomizedEncryptionRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setSignaturePaddings(self, *paddings: java.lang.String) -> KeyGenParameterSpec.Builder: ...
        def setUnlockedDeviceRequired(self, unlockedDeviceRequired: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setUserAuthenticationParameters(self, timeout: int | java.jint | java.lang.Integer, type: int | java.jint | java.lang.Integer, /) -> KeyGenParameterSpec.Builder: ...
        def setUserAuthenticationRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setUserAuthenticationValidWhileOnBody(self, remainsValid: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setUserAuthenticationValidityDurationSeconds(self, seconds: int | java.jint | java.lang.Integer, /) -> KeyGenParameterSpec.Builder: ...
        def setUserConfirmationRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...
        def setUserPresenceRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyGenParameterSpec.Builder: ...

class KeyInfo(java.security.spec.KeySpec):
    def getBlockModes(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getDigests(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getEncryptionPaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getKeySize(self) -> int: ...
    def getKeyValidityForConsumptionEnd(self) -> java.util.Date | None: ...
    def getKeyValidityForOriginationEnd(self) -> java.util.Date | None: ...
    def getKeyValidityStart(self) -> java.util.Date | None: ...
    def getKeystoreAlias(self) -> str: ...
    def getOrigin(self) -> int: ...
    def getPurposes(self) -> int: ...
    def getRemainingUsageCount(self) -> int: ...
    def getSecurityLevel(self) -> int: ...
    def getSignaturePaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getUserAuthenticationType(self) -> int: ...
    def getUserAuthenticationValidityDurationSeconds(self) -> int: ...
    def isInsideSecureHardware(self) -> bool: ...
    def isInvalidatedByBiometricEnrollment(self) -> bool: ...
    def isTrustedUserPresenceRequired(self) -> bool: ...
    def isUserAuthenticationRequired(self) -> bool: ...
    def isUserAuthenticationRequirementEnforcedBySecureHardware(self) -> bool: ...
    def isUserAuthenticationValidWhileOnBody(self) -> bool: ...
    def isUserConfirmationRequired(self) -> bool: ...

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

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

class KeyProperties(java.lang.Object):
    AUTH_BIOMETRIC_STRONG: typing.ClassVar[int] = ...
    AUTH_DEVICE_CREDENTIAL: typing.ClassVar[int] = ...
    BLOCK_MODE_CBC: typing.ClassVar[str] = ...
    BLOCK_MODE_CTR: typing.ClassVar[str] = ...
    BLOCK_MODE_ECB: typing.ClassVar[str] = ...
    BLOCK_MODE_GCM: typing.ClassVar[str] = ...
    DIGEST_MD5: typing.ClassVar[str] = ...
    DIGEST_NONE: typing.ClassVar[str] = ...
    DIGEST_SHA1: typing.ClassVar[str] = ...
    DIGEST_SHA224: typing.ClassVar[str] = ...
    DIGEST_SHA256: typing.ClassVar[str] = ...
    DIGEST_SHA384: typing.ClassVar[str] = ...
    DIGEST_SHA512: typing.ClassVar[str] = ...
    ENCRYPTION_PADDING_NONE: typing.ClassVar[str] = ...
    ENCRYPTION_PADDING_PKCS7: typing.ClassVar[str] = ...
    ENCRYPTION_PADDING_RSA_OAEP: typing.ClassVar[str] = ...
    ENCRYPTION_PADDING_RSA_PKCS1: typing.ClassVar[str] = ...
    KEY_ALGORITHM_3DES: typing.ClassVar[str] = ...
    KEY_ALGORITHM_AES: typing.ClassVar[str] = ...
    KEY_ALGORITHM_EC: typing.ClassVar[str] = ...
    KEY_ALGORITHM_HMAC_SHA1: typing.ClassVar[str] = ...
    KEY_ALGORITHM_HMAC_SHA224: typing.ClassVar[str] = ...
    KEY_ALGORITHM_HMAC_SHA256: typing.ClassVar[str] = ...
    KEY_ALGORITHM_HMAC_SHA384: typing.ClassVar[str] = ...
    KEY_ALGORITHM_HMAC_SHA512: typing.ClassVar[str] = ...
    KEY_ALGORITHM_RSA: typing.ClassVar[str] = ...
    ORIGIN_GENERATED: typing.ClassVar[int] = ...
    ORIGIN_IMPORTED: typing.ClassVar[int] = ...
    ORIGIN_SECURELY_IMPORTED: typing.ClassVar[int] = ...
    ORIGIN_UNKNOWN: typing.ClassVar[int] = ...
    PURPOSE_AGREE_KEY: typing.ClassVar[int] = ...
    PURPOSE_ATTEST_KEY: typing.ClassVar[int] = ...
    PURPOSE_DECRYPT: typing.ClassVar[int] = ...
    PURPOSE_ENCRYPT: typing.ClassVar[int] = ...
    PURPOSE_SIGN: typing.ClassVar[int] = ...
    PURPOSE_VERIFY: typing.ClassVar[int] = ...
    PURPOSE_WRAP_KEY: typing.ClassVar[int] = ...
    SECURITY_LEVEL_SOFTWARE: typing.ClassVar[int] = ...
    SECURITY_LEVEL_STRONGBOX: typing.ClassVar[int] = ...
    SECURITY_LEVEL_TRUSTED_ENVIRONMENT: typing.ClassVar[int] = ...
    SECURITY_LEVEL_UNKNOWN: typing.ClassVar[int] = ...
    SECURITY_LEVEL_UNKNOWN_SECURE: typing.ClassVar[int] = ...
    SIGNATURE_PADDING_RSA_PKCS1: typing.ClassVar[str] = ...
    SIGNATURE_PADDING_RSA_PSS: typing.ClassVar[str] = ...
    UNRESTRICTED_USAGE_COUNT: typing.ClassVar[int] = ...

class KeyProtection(java.security.KeyStore.ProtectionParameter):
    def getBlockModes(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getDigests(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getEncryptionPaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getKeyValidityForConsumptionEnd(self) -> java.util.Date | None: ...
    def getKeyValidityForOriginationEnd(self) -> java.util.Date | None: ...
    def getKeyValidityStart(self) -> java.util.Date | None: ...
    def getMaxUsageCount(self) -> int: ...
    def getMgf1Digests(self) -> java.util.Set[java.lang.String]: ...
    def getPurposes(self) -> int: ...
    def getSignaturePaddings(self) -> java.chaquopy.JavaArray[java.lang.String]: ...
    def getUserAuthenticationType(self) -> int: ...
    def getUserAuthenticationValidityDurationSeconds(self) -> int: ...
    def isDigestsSpecified(self) -> bool: ...
    def isInvalidatedByBiometricEnrollment(self) -> bool: ...
    def isMgf1DigestsSpecified(self) -> bool: ...
    def isRandomizedEncryptionRequired(self) -> bool: ...
    def isUnlockedDeviceRequired(self) -> bool: ...
    def isUserAuthenticationRequired(self) -> bool: ...
    def isUserAuthenticationValidWhileOnBody(self) -> bool: ...
    def isUserConfirmationRequired(self) -> bool: ...
    def isUserPresenceRequired(self) -> bool: ...

    class Builder(java.lang.Object):
        def __init__(self, purposes: int | java.jint | java.lang.Integer, /) -> None: ...
        def build(self) -> KeyProtection: ...
        def setBlockModes(self, *blockModes: java.lang.String) -> KeyProtection.Builder: ...
        def setDigests(self, *digests: java.lang.String) -> KeyProtection.Builder: ...
        def setEncryptionPaddings(self, *paddings: java.lang.String) -> KeyProtection.Builder: ...
        def setInvalidatedByBiometricEnrollment(self, invalidateKey: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setIsStrongBoxBacked(self, isStrongBoxBacked: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setKeyValidityEnd(self, endDate: java.util.Date, /) -> KeyProtection.Builder: ...
        def setKeyValidityForConsumptionEnd(self, endDate: java.util.Date, /) -> KeyProtection.Builder: ...
        def setKeyValidityForOriginationEnd(self, endDate: java.util.Date, /) -> KeyProtection.Builder: ...
        def setKeyValidityStart(self, startDate: java.util.Date, /) -> KeyProtection.Builder: ...
        def setMaxUsageCount(self, maxUsageCount: int | java.jint | java.lang.Integer, /) -> KeyProtection.Builder: ...
        def setMgf1Digests(self, *mgf1Digests: java.lang.String) -> KeyProtection.Builder: ...
        def setRandomizedEncryptionRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setSignaturePaddings(self, *paddings: java.lang.String) -> KeyProtection.Builder: ...
        def setUnlockedDeviceRequired(self, unlockedDeviceRequired: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setUserAuthenticationParameters(self, timeout: int | java.jint | java.lang.Integer, type: int | java.jint | java.lang.Integer, /) -> KeyProtection.Builder: ...
        def setUserAuthenticationRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setUserAuthenticationValidWhileOnBody(self, remainsValid: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setUserAuthenticationValidityDurationSeconds(self, seconds: int | java.jint | java.lang.Integer, /) -> KeyProtection.Builder: ...
        def setUserConfirmationRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...
        def setUserPresenceRequired(self, required: bool | java.jboolean | java.lang.Boolean, /) -> KeyProtection.Builder: ...

class KeyStoreManager(java.lang.Object):
    MODULE_HASH: typing.ClassVar[int] = ...
    def getGrantedCertificateChainFromId(self, id: int | java.jlong | java.lang.Long, /) -> java.util.List[java.security.cert.X509Certificate]: ...
    def getGrantedKeyFromId(self, id: int | java.jlong | java.lang.Long, /) -> java.security.Key: ...
    def getGrantedKeyPairFromId(self, id: int | java.jlong | java.lang.Long, /) -> java.security.KeyPair: ...
    def getSupplementaryAttestationInfo(self, tag: int | java.jint | java.lang.Integer, /) -> java.chaquopy.JavaArrayJByte: ...
    def grantKeyAccess(self, alias: str | java.lang.String, uid: int | java.jint | java.lang.Integer, /) -> int: ...
    def revokeKeyAccess(self, alias: str | java.lang.String, uid: int | java.jint | java.lang.Integer, /) -> None: ...

class SecureKeyImportUnavailableException(java.security.ProviderException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: 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 StrongBoxUnavailableException(java.security.ProviderException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: 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 UserNotAuthenticatedException(java.security.InvalidKeyException):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, /) -> None: ...
    @typing.overload
    def __init__(self, message: str | java.lang.String, cause: java.lang.Throwable, /) -> None: ...

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

class WrappedKeyEntry(java.security.KeyStore.Entry):
    def __init__(self, wrappedKeyBytes: java.chaquopy.JavaArrayJByte, wrappingKeyAlias: str | java.lang.String, transformation: str | java.lang.String, algorithmParameterSpec: java.security.spec.AlgorithmParameterSpec, /) -> None: ...
    def getAlgorithmParameterSpec(self) -> java.security.spec.AlgorithmParameterSpec: ...
    def getTransformation(self) -> str: ...
    def getWrappedKeyBytes(self) -> java.chaquopy.JavaArrayJByte: ...
    def getWrappingKeyAlias(self) -> str: ...
