"""Type stubs for the _pkcs11 Cython extension module."""

from __future__ import annotations

from typing import Any, Iterator

from pkcs11.types import Slot, Token

class lib:
    """Main entry point for PKCS#11 library."""

    so: str
    manufacturer_id: str
    library_description: str
    initialized: bool

    def __init__(self, so: str) -> None: ...
    @property
    def library_version(self) -> tuple[int, int]: ...
    @property
    def cryptoki_version(self) -> tuple[int, int]: ...
    def initialize(self) -> None: ...
    def finalize(self) -> None: ...
    def reinitialize(self) -> None: ...
    def unload(self) -> None: ...
    def get_slots(self, token_present: bool = False) -> list[Slot]: ...
    def get_tokens(
        self,
        token_label: str | None = None,
        token_serial: bytes | None = None,
        token_flags: Any | None = None,
        slot_flags: Any | None = None,
        mechanisms: Any | None = None,
    ) -> Iterator[Token]: ...
    def get_token(self, **kwargs: Any) -> Token: ...
    def wait_for_slot_event(self, blocking: bool = True) -> Slot: ...
    def __str__(self) -> str: ...
    def __repr__(self) -> str: ...
