"""Per-transaction reader-side state for an Aliro NFC transaction."""

from dataclasses import dataclass
from typing import Optional

from cryptography.hazmat.primitives.asymmetric import ec


@dataclass
class ReaderSession:
    """Mutable per-transaction state. Mirrors fields kept in the Java
    ReaderSide test fixture (applet/src/test/.../ReaderSide.java)."""

    reader_ephem_priv: Optional[ec.EllipticCurvePrivateKey] = None
    transaction_id: Optional[bytes] = None
    credential_ephem_pubk: Optional[bytes] = None  # 65B uncompressed, captured from AUTH0 response

    @classmethod
    def fresh(cls) -> "ReaderSession":
        return cls()
