"""TESM-Lizenzprotokoll -- gemeinsames Paket von TESM und TESM-Lizenzserver.

Im Vorgaengerprojekt lag dieses Modul als handkopierte, byte-identisch zu
haltende ``licensing.py`` in beiden Repos. Jede unabhaengige Aenderung an nur
einer Kopie brach die gegenseitige Signaturpruefung, ohne dass das lokal
auffiel. Hier ist es ein installierbares Paket mit eigener Version -- die
Invariante ist damit strukturell erfuellt statt durch Disziplin.
"""

from __future__ import annotations

from .canonical import (
    SIG_CONTEXT_LICENSE,
    SIG_CONTEXT_REQUEST,
    SIG_CONTEXT_RESPONSE,
    canonical_bytes,
    decode_code,
    encode_code,
    sign,
    verify,
)
from .errors import (
    InvalidLicenseFile,
    LicensingError,
    ProtocolViolation,
    ReplayDetected,
    SignatureInvalid,
    UntrustedIssuer,
)
from .fingerprint import machine_identity, system_fingerprint
from .license import (
    ALL_MODULES,
    EXPIRY_WARNING_DAYS,
    FORMAT_VERSION,
    GRACE_PERIOD_DAYS,
    HEARTBEAT_WARNING_DAYS,
    LICENSE_ROLES,
    LICENSE_TYPE_LABELS,
    LICENSE_TYPES,
    LIFETIME_EXPIRES_AT,
    MODULE_LABELS,
    ROLE_LABELS,
    TRIAL_DEFAULT_DAYS,
    LicenseStatus,
    iso,
    key_id,
    license_status,
    parse_iso,
    split_bundle,
    utcnow,
    verify_license,
)
from .protocol import (
    ACTIONS,
    CLOCK_SKEW_SECONDS,
    HEARTBEAT_INTERVAL_SECONDS,
    MAX_REPORT_ROWS,
    REQUEST_MAX_AGE_SECONDS,
    RESPONSE_STATES,
    build_client_request,
    new_nonce,
    verify_master_response,
)

__version__ = "2.0.0"

__all__ = [
    "ACTIONS",
    "ALL_MODULES",
    "CLOCK_SKEW_SECONDS",
    "EXPIRY_WARNING_DAYS",
    "FORMAT_VERSION",
    "GRACE_PERIOD_DAYS",
    "HEARTBEAT_INTERVAL_SECONDS",
    "HEARTBEAT_WARNING_DAYS",
    "InvalidLicenseFile",
    "LICENSE_ROLES",
    "LICENSE_TYPES",
    "LICENSE_TYPE_LABELS",
    "LIFETIME_EXPIRES_AT",
    "LicenseStatus",
    "LicensingError",
    "MAX_REPORT_ROWS",
    "MODULE_LABELS",
    "ProtocolViolation",
    "REQUEST_MAX_AGE_SECONDS",
    "RESPONSE_STATES",
    "ROLE_LABELS",
    "ReplayDetected",
    "SIG_CONTEXT_LICENSE",
    "SIG_CONTEXT_REQUEST",
    "SIG_CONTEXT_RESPONSE",
    "SignatureInvalid",
    "TRIAL_DEFAULT_DAYS",
    "UntrustedIssuer",
    "build_client_request",
    "canonical_bytes",
    "decode_code",
    "encode_code",
    "iso",
    "key_id",
    "license_status",
    "machine_identity",
    "new_nonce",
    "parse_iso",
    "sign",
    "split_bundle",
    "system_fingerprint",
    "utcnow",
    "verify",
    "verify_license",
    "verify_master_response",
]
