Skip to content

smart_card_emulation

BeginTransactionRequested dataclass

Fired when SCardBeginTransaction is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.beginTransactionRequested")
@dataclass
class BeginTransactionRequested:
    """
    Fired when ``SCardBeginTransaction`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction
    """

    request_id: str
    handle: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> BeginTransactionRequested:
        return cls(request_id=str(json["requestId"]), handle=int(json["handle"]))

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> BeginTransactionRequested:
    return cls(request_id=str(json["requestId"]), handle=int(json["handle"]))

CancelRequested dataclass

Fired when SCardCancel is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.cancelRequested")
@dataclass
class CancelRequested:
    """
    Fired when ``SCardCancel`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel
    """

    request_id: str
    context_id: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> CancelRequested:
        return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

context_id: int instance-attribute

request_id: str instance-attribute

__init__(request_id, context_id)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> CancelRequested:
    return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

ConnectRequested dataclass

Fired when SCardConnect is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.connectRequested")
@dataclass
class ConnectRequested:
    """
    Fired when ``SCardConnect`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta
    """

    request_id: str
    context_id: int
    reader: str
    share_mode: ShareMode
    preferred_protocols: ProtocolSet

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ConnectRequested:
        return cls(
            request_id=str(json["requestId"]),
            context_id=int(json["contextId"]),
            reader=str(json["reader"]),
            share_mode=ShareMode.from_json(json["shareMode"]),
            preferred_protocols=ProtocolSet.from_json(json["preferredProtocols"]),
        )

context_id: int instance-attribute

preferred_protocols: ProtocolSet instance-attribute

reader: str instance-attribute

request_id: str instance-attribute

share_mode: ShareMode instance-attribute

__init__(request_id, context_id, reader, share_mode, preferred_protocols)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ConnectRequested:
    return cls(
        request_id=str(json["requestId"]),
        context_id=int(json["contextId"]),
        reader=str(json["reader"]),
        share_mode=ShareMode.from_json(json["shareMode"]),
        preferred_protocols=ProtocolSet.from_json(json["preferredProtocols"]),
    )

ConnectionState

Bases: Enum

Maps to SCARD_* connection state values.

Source code in zendriver/cdp/smart_card_emulation.py
class ConnectionState(enum.Enum):
    """
    Maps to ``SCARD_*`` connection state values.
    """

    ABSENT = "absent"
    PRESENT = "present"
    SWALLOWED = "swallowed"
    POWERED = "powered"
    NEGOTIABLE = "negotiable"
    SPECIFIC = "specific"

    def to_json(self) -> str:
        return self.value

    @classmethod
    def from_json(cls, json: str) -> ConnectionState:
        return cls(json)

ABSENT = 'absent' class-attribute instance-attribute

NEGOTIABLE = 'negotiable' class-attribute instance-attribute

POWERED = 'powered' class-attribute instance-attribute

PRESENT = 'present' class-attribute instance-attribute

SPECIFIC = 'specific' class-attribute instance-attribute

SWALLOWED = 'swallowed' class-attribute instance-attribute

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: str) -> ConnectionState:
    return cls(json)

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> str:
    return self.value

ControlRequested dataclass

Fired when SCardControl is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.controlRequested")
@dataclass
class ControlRequested:
    """
    Fired when ``SCardControl`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol
    """

    request_id: str
    handle: int
    control_code: int
    data: str

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ControlRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            control_code=int(json["controlCode"]),
            data=str(json["data"]),
        )

control_code: int instance-attribute

data: str instance-attribute

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, control_code, data)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ControlRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        control_code=int(json["controlCode"]),
        data=str(json["data"]),
    )

DisconnectRequested dataclass

Fired when SCardDisconnect is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.disconnectRequested")
@dataclass
class DisconnectRequested:
    """
    Fired when ``SCardDisconnect`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect
    """

    request_id: str
    handle: int
    disposition: Disposition

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> DisconnectRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            disposition=Disposition.from_json(json["disposition"]),
        )

disposition: Disposition instance-attribute

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, disposition)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> DisconnectRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        disposition=Disposition.from_json(json["disposition"]),
    )

Disposition

Bases: Enum

Indicates what the reader should do with the card.

Source code in zendriver/cdp/smart_card_emulation.py
class Disposition(enum.Enum):
    """
    Indicates what the reader should do with the card.
    """

    LEAVE_CARD = "leave-card"
    RESET_CARD = "reset-card"
    UNPOWER_CARD = "unpower-card"
    EJECT_CARD = "eject-card"

    def to_json(self) -> str:
        return self.value

    @classmethod
    def from_json(cls, json: str) -> Disposition:
        return cls(json)

EJECT_CARD = 'eject-card' class-attribute instance-attribute

LEAVE_CARD = 'leave-card' class-attribute instance-attribute

RESET_CARD = 'reset-card' class-attribute instance-attribute

UNPOWER_CARD = 'unpower-card' class-attribute instance-attribute

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: str) -> Disposition:
    return cls(json)

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> str:
    return self.value

EndTransactionRequested dataclass

Fired when SCardEndTransaction is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.endTransactionRequested")
@dataclass
class EndTransactionRequested:
    """
    Fired when ``SCardEndTransaction`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction
    """

    request_id: str
    handle: int
    disposition: Disposition

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> EndTransactionRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            disposition=Disposition.from_json(json["disposition"]),
        )

disposition: Disposition instance-attribute

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, disposition)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> EndTransactionRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        disposition=Disposition.from_json(json["disposition"]),
    )

EstablishContextRequested dataclass

Fired when SCardEstablishContext is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.establishContextRequested")
@dataclass
class EstablishContextRequested:
    """
    Fired when ``SCardEstablishContext`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext
    """

    request_id: str

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> EstablishContextRequested:
        return cls(request_id=str(json["requestId"]))

request_id: str instance-attribute

__init__(request_id)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> EstablishContextRequested:
    return cls(request_id=str(json["requestId"]))

GetAttribRequested dataclass

Fired when SCardGetAttrib is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.getAttribRequested")
@dataclass
class GetAttribRequested:
    """
    Fired when ``SCardGetAttrib`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib
    """

    request_id: str
    handle: int
    attrib_id: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> GetAttribRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            attrib_id=int(json["attribId"]),
        )

attrib_id: int instance-attribute

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, attrib_id)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> GetAttribRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        attrib_id=int(json["attribId"]),
    )

GetStatusChangeRequested dataclass

Fired when SCardGetStatusChange is called. Timeout is specified in milliseconds.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.getStatusChangeRequested")
@dataclass
class GetStatusChangeRequested:
    """
    Fired when ``SCardGetStatusChange`` is called. Timeout is specified in milliseconds.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea
    """

    request_id: str
    context_id: int
    reader_states: typing.List[ReaderStateIn]
    #: in milliseconds, if absent, it means "infinite"
    timeout: typing.Optional[int]

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> GetStatusChangeRequested:
        return cls(
            request_id=str(json["requestId"]),
            context_id=int(json["contextId"]),
            reader_states=[ReaderStateIn.from_json(i) for i in json["readerStates"]],
            timeout=int(json["timeout"])
            if json.get("timeout", None) is not None
            else None,
        )

context_id: int instance-attribute

reader_states: typing.List[ReaderStateIn] instance-attribute

request_id: str instance-attribute

timeout: typing.Optional[int] instance-attribute

__init__(request_id, context_id, reader_states, timeout)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> GetStatusChangeRequested:
    return cls(
        request_id=str(json["requestId"]),
        context_id=int(json["contextId"]),
        reader_states=[ReaderStateIn.from_json(i) for i in json["readerStates"]],
        timeout=int(json["timeout"])
        if json.get("timeout", None) is not None
        else None,
    )

ListReadersRequested dataclass

Fired when SCardListReaders is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.listReadersRequested")
@dataclass
class ListReadersRequested:
    """
    Fired when ``SCardListReaders`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa
    """

    request_id: str
    context_id: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ListReadersRequested:
        return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

context_id: int instance-attribute

request_id: str instance-attribute

__init__(request_id, context_id)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ListReadersRequested:
    return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

Protocol

Bases: Enum

Maps to the SCARD_PROTOCOL_* values.

Source code in zendriver/cdp/smart_card_emulation.py
class Protocol(enum.Enum):
    """
    Maps to the ``SCARD_PROTOCOL_*`` values.
    """

    T0 = "t0"
    T1 = "t1"
    RAW = "raw"

    def to_json(self) -> str:
        return self.value

    @classmethod
    def from_json(cls, json: str) -> Protocol:
        return cls(json)

RAW = 'raw' class-attribute instance-attribute

T0 = 't0' class-attribute instance-attribute

T1 = 't1' class-attribute instance-attribute

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: str) -> Protocol:
    return cls(json)

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> str:
    return self.value

ProtocolSet dataclass

Maps to the SCARD_PROTOCOL_* flags.

Source code in zendriver/cdp/smart_card_emulation.py
@dataclass
class ProtocolSet:
    """
    Maps to the ``SCARD_PROTOCOL_*`` flags.
    """

    t0: typing.Optional[bool] = None

    t1: typing.Optional[bool] = None

    raw: typing.Optional[bool] = None

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        if self.t0 is not None:
            json["t0"] = self.t0
        if self.t1 is not None:
            json["t1"] = self.t1
        if self.raw is not None:
            json["raw"] = self.raw
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ProtocolSet:
        return cls(
            t0=bool(json["t0"]) if json.get("t0", None) is not None else None,
            t1=bool(json["t1"]) if json.get("t1", None) is not None else None,
            raw=bool(json["raw"]) if json.get("raw", None) is not None else None,
        )

raw: typing.Optional[bool] = None class-attribute instance-attribute

t0: typing.Optional[bool] = None class-attribute instance-attribute

t1: typing.Optional[bool] = None class-attribute instance-attribute

__init__(t0=None, t1=None, raw=None)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ProtocolSet:
    return cls(
        t0=bool(json["t0"]) if json.get("t0", None) is not None else None,
        t1=bool(json["t1"]) if json.get("t1", None) is not None else None,
        raw=bool(json["raw"]) if json.get("raw", None) is not None else None,
    )

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    if self.t0 is not None:
        json["t0"] = self.t0
    if self.t1 is not None:
        json["t1"] = self.t1
    if self.raw is not None:
        json["raw"] = self.raw
    return json

ReaderStateFlags dataclass

Maps to the SCARD_STATE_* flags.

Source code in zendriver/cdp/smart_card_emulation.py
@dataclass
class ReaderStateFlags:
    """
    Maps to the ``SCARD_STATE_*`` flags.
    """

    unaware: typing.Optional[bool] = None

    ignore: typing.Optional[bool] = None

    changed: typing.Optional[bool] = None

    unknown: typing.Optional[bool] = None

    unavailable: typing.Optional[bool] = None

    empty: typing.Optional[bool] = None

    present: typing.Optional[bool] = None

    exclusive: typing.Optional[bool] = None

    inuse: typing.Optional[bool] = None

    mute: typing.Optional[bool] = None

    unpowered: typing.Optional[bool] = None

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        if self.unaware is not None:
            json["unaware"] = self.unaware
        if self.ignore is not None:
            json["ignore"] = self.ignore
        if self.changed is not None:
            json["changed"] = self.changed
        if self.unknown is not None:
            json["unknown"] = self.unknown
        if self.unavailable is not None:
            json["unavailable"] = self.unavailable
        if self.empty is not None:
            json["empty"] = self.empty
        if self.present is not None:
            json["present"] = self.present
        if self.exclusive is not None:
            json["exclusive"] = self.exclusive
        if self.inuse is not None:
            json["inuse"] = self.inuse
        if self.mute is not None:
            json["mute"] = self.mute
        if self.unpowered is not None:
            json["unpowered"] = self.unpowered
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ReaderStateFlags:
        return cls(
            unaware=bool(json["unaware"])
            if json.get("unaware", None) is not None
            else None,
            ignore=bool(json["ignore"])
            if json.get("ignore", None) is not None
            else None,
            changed=bool(json["changed"])
            if json.get("changed", None) is not None
            else None,
            unknown=bool(json["unknown"])
            if json.get("unknown", None) is not None
            else None,
            unavailable=bool(json["unavailable"])
            if json.get("unavailable", None) is not None
            else None,
            empty=bool(json["empty"]) if json.get("empty", None) is not None else None,
            present=bool(json["present"])
            if json.get("present", None) is not None
            else None,
            exclusive=bool(json["exclusive"])
            if json.get("exclusive", None) is not None
            else None,
            inuse=bool(json["inuse"]) if json.get("inuse", None) is not None else None,
            mute=bool(json["mute"]) if json.get("mute", None) is not None else None,
            unpowered=bool(json["unpowered"])
            if json.get("unpowered", None) is not None
            else None,
        )

changed: typing.Optional[bool] = None class-attribute instance-attribute

empty: typing.Optional[bool] = None class-attribute instance-attribute

exclusive: typing.Optional[bool] = None class-attribute instance-attribute

ignore: typing.Optional[bool] = None class-attribute instance-attribute

inuse: typing.Optional[bool] = None class-attribute instance-attribute

mute: typing.Optional[bool] = None class-attribute instance-attribute

present: typing.Optional[bool] = None class-attribute instance-attribute

unavailable: typing.Optional[bool] = None class-attribute instance-attribute

unaware: typing.Optional[bool] = None class-attribute instance-attribute

unknown: typing.Optional[bool] = None class-attribute instance-attribute

unpowered: typing.Optional[bool] = None class-attribute instance-attribute

__init__(unaware=None, ignore=None, changed=None, unknown=None, unavailable=None, empty=None, present=None, exclusive=None, inuse=None, mute=None, unpowered=None)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ReaderStateFlags:
    return cls(
        unaware=bool(json["unaware"])
        if json.get("unaware", None) is not None
        else None,
        ignore=bool(json["ignore"])
        if json.get("ignore", None) is not None
        else None,
        changed=bool(json["changed"])
        if json.get("changed", None) is not None
        else None,
        unknown=bool(json["unknown"])
        if json.get("unknown", None) is not None
        else None,
        unavailable=bool(json["unavailable"])
        if json.get("unavailable", None) is not None
        else None,
        empty=bool(json["empty"]) if json.get("empty", None) is not None else None,
        present=bool(json["present"])
        if json.get("present", None) is not None
        else None,
        exclusive=bool(json["exclusive"])
        if json.get("exclusive", None) is not None
        else None,
        inuse=bool(json["inuse"]) if json.get("inuse", None) is not None else None,
        mute=bool(json["mute"]) if json.get("mute", None) is not None else None,
        unpowered=bool(json["unpowered"])
        if json.get("unpowered", None) is not None
        else None,
    )

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    if self.unaware is not None:
        json["unaware"] = self.unaware
    if self.ignore is not None:
        json["ignore"] = self.ignore
    if self.changed is not None:
        json["changed"] = self.changed
    if self.unknown is not None:
        json["unknown"] = self.unknown
    if self.unavailable is not None:
        json["unavailable"] = self.unavailable
    if self.empty is not None:
        json["empty"] = self.empty
    if self.present is not None:
        json["present"] = self.present
    if self.exclusive is not None:
        json["exclusive"] = self.exclusive
    if self.inuse is not None:
        json["inuse"] = self.inuse
    if self.mute is not None:
        json["mute"] = self.mute
    if self.unpowered is not None:
        json["unpowered"] = self.unpowered
    return json

ReaderStateIn dataclass

Source code in zendriver/cdp/smart_card_emulation.py
@dataclass
class ReaderStateIn:
    reader: str

    current_state: ReaderStateFlags

    current_insertion_count: int

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["reader"] = self.reader
        json["currentState"] = self.current_state.to_json()
        json["currentInsertionCount"] = self.current_insertion_count
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ReaderStateIn:
        return cls(
            reader=str(json["reader"]),
            current_state=ReaderStateFlags.from_json(json["currentState"]),
            current_insertion_count=int(json["currentInsertionCount"]),
        )

current_insertion_count: int instance-attribute

current_state: ReaderStateFlags instance-attribute

reader: str instance-attribute

__init__(reader, current_state, current_insertion_count)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ReaderStateIn:
    return cls(
        reader=str(json["reader"]),
        current_state=ReaderStateFlags.from_json(json["currentState"]),
        current_insertion_count=int(json["currentInsertionCount"]),
    )

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["reader"] = self.reader
    json["currentState"] = self.current_state.to_json()
    json["currentInsertionCount"] = self.current_insertion_count
    return json

ReaderStateOut dataclass

Source code in zendriver/cdp/smart_card_emulation.py
@dataclass
class ReaderStateOut:
    reader: str

    event_state: ReaderStateFlags

    event_count: int

    atr: str

    def to_json(self) -> T_JSON_DICT:
        json: T_JSON_DICT = dict()
        json["reader"] = self.reader
        json["eventState"] = self.event_state.to_json()
        json["eventCount"] = self.event_count
        json["atr"] = self.atr
        return json

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ReaderStateOut:
        return cls(
            reader=str(json["reader"]),
            event_state=ReaderStateFlags.from_json(json["eventState"]),
            event_count=int(json["eventCount"]),
            atr=str(json["atr"]),
        )

atr: str instance-attribute

event_count: int instance-attribute

event_state: ReaderStateFlags instance-attribute

reader: str instance-attribute

__init__(reader, event_state, event_count, atr)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ReaderStateOut:
    return cls(
        reader=str(json["reader"]),
        event_state=ReaderStateFlags.from_json(json["eventState"]),
        event_count=int(json["eventCount"]),
        atr=str(json["atr"]),
    )

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> T_JSON_DICT:
    json: T_JSON_DICT = dict()
    json["reader"] = self.reader
    json["eventState"] = self.event_state.to_json()
    json["eventCount"] = self.event_count
    json["atr"] = self.atr
    return json

ReleaseContextRequested dataclass

Fired when SCardReleaseContext is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.releaseContextRequested")
@dataclass
class ReleaseContextRequested:
    """
    Fired when ``SCardReleaseContext`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext
    """

    request_id: str
    context_id: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> ReleaseContextRequested:
        return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

context_id: int instance-attribute

request_id: str instance-attribute

__init__(request_id, context_id)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> ReleaseContextRequested:
    return cls(request_id=str(json["requestId"]), context_id=int(json["contextId"]))

ResultCode

Bases: Enum

Indicates the PC/SC error code.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html Microsoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values

Source code in zendriver/cdp/smart_card_emulation.py
class ResultCode(enum.Enum):
    """
    Indicates the PC/SC error code.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__ErrorCodes.html
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/secauthn/authentication-return-values
    """

    SUCCESS = "success"
    REMOVED_CARD = "removed-card"
    RESET_CARD = "reset-card"
    UNPOWERED_CARD = "unpowered-card"
    UNRESPONSIVE_CARD = "unresponsive-card"
    UNSUPPORTED_CARD = "unsupported-card"
    READER_UNAVAILABLE = "reader-unavailable"
    SHARING_VIOLATION = "sharing-violation"
    NOT_TRANSACTED = "not-transacted"
    NO_SMARTCARD = "no-smartcard"
    PROTO_MISMATCH = "proto-mismatch"
    SYSTEM_CANCELLED = "system-cancelled"
    NOT_READY = "not-ready"
    CANCELLED = "cancelled"
    INSUFFICIENT_BUFFER = "insufficient-buffer"
    INVALID_HANDLE = "invalid-handle"
    INVALID_PARAMETER = "invalid-parameter"
    INVALID_VALUE = "invalid-value"
    NO_MEMORY = "no-memory"
    TIMEOUT = "timeout"
    UNKNOWN_READER = "unknown-reader"
    UNSUPPORTED_FEATURE = "unsupported-feature"
    NO_READERS_AVAILABLE = "no-readers-available"
    SERVICE_STOPPED = "service-stopped"
    NO_SERVICE = "no-service"
    COMM_ERROR = "comm-error"
    INTERNAL_ERROR = "internal-error"
    SERVER_TOO_BUSY = "server-too-busy"
    UNEXPECTED = "unexpected"
    SHUTDOWN = "shutdown"
    UNKNOWN_CARD = "unknown-card"
    UNKNOWN = "unknown"

    def to_json(self) -> str:
        return self.value

    @classmethod
    def from_json(cls, json: str) -> ResultCode:
        return cls(json)

CANCELLED = 'cancelled' class-attribute instance-attribute

COMM_ERROR = 'comm-error' class-attribute instance-attribute

INSUFFICIENT_BUFFER = 'insufficient-buffer' class-attribute instance-attribute

INTERNAL_ERROR = 'internal-error' class-attribute instance-attribute

INVALID_HANDLE = 'invalid-handle' class-attribute instance-attribute

INVALID_PARAMETER = 'invalid-parameter' class-attribute instance-attribute

INVALID_VALUE = 'invalid-value' class-attribute instance-attribute

NOT_READY = 'not-ready' class-attribute instance-attribute

NOT_TRANSACTED = 'not-transacted' class-attribute instance-attribute

NO_MEMORY = 'no-memory' class-attribute instance-attribute

NO_READERS_AVAILABLE = 'no-readers-available' class-attribute instance-attribute

NO_SERVICE = 'no-service' class-attribute instance-attribute

NO_SMARTCARD = 'no-smartcard' class-attribute instance-attribute

PROTO_MISMATCH = 'proto-mismatch' class-attribute instance-attribute

READER_UNAVAILABLE = 'reader-unavailable' class-attribute instance-attribute

REMOVED_CARD = 'removed-card' class-attribute instance-attribute

RESET_CARD = 'reset-card' class-attribute instance-attribute

SERVER_TOO_BUSY = 'server-too-busy' class-attribute instance-attribute

SERVICE_STOPPED = 'service-stopped' class-attribute instance-attribute

SHARING_VIOLATION = 'sharing-violation' class-attribute instance-attribute

SHUTDOWN = 'shutdown' class-attribute instance-attribute

SUCCESS = 'success' class-attribute instance-attribute

SYSTEM_CANCELLED = 'system-cancelled' class-attribute instance-attribute

TIMEOUT = 'timeout' class-attribute instance-attribute

UNEXPECTED = 'unexpected' class-attribute instance-attribute

UNKNOWN = 'unknown' class-attribute instance-attribute

UNKNOWN_CARD = 'unknown-card' class-attribute instance-attribute

UNKNOWN_READER = 'unknown-reader' class-attribute instance-attribute

UNPOWERED_CARD = 'unpowered-card' class-attribute instance-attribute

UNRESPONSIVE_CARD = 'unresponsive-card' class-attribute instance-attribute

UNSUPPORTED_CARD = 'unsupported-card' class-attribute instance-attribute

UNSUPPORTED_FEATURE = 'unsupported-feature' class-attribute instance-attribute

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: str) -> ResultCode:
    return cls(json)

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> str:
    return self.value

SetAttribRequested dataclass

Fired when SCardSetAttrib is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.setAttribRequested")
@dataclass
class SetAttribRequested:
    """
    Fired when ``SCardSetAttrib`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib
    """

    request_id: str
    handle: int
    attrib_id: int
    data: str

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> SetAttribRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            attrib_id=int(json["attribId"]),
            data=str(json["data"]),
        )

attrib_id: int instance-attribute

data: str instance-attribute

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, attrib_id, data)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> SetAttribRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        attrib_id=int(json["attribId"]),
        data=str(json["data"]),
    )

ShareMode

Bases: Enum

Maps to the SCARD_SHARE_* values.

Source code in zendriver/cdp/smart_card_emulation.py
class ShareMode(enum.Enum):
    """
    Maps to the ``SCARD_SHARE_*`` values.
    """

    SHARED = "shared"
    EXCLUSIVE = "exclusive"
    DIRECT = "direct"

    def to_json(self) -> str:
        return self.value

    @classmethod
    def from_json(cls, json: str) -> ShareMode:
        return cls(json)

DIRECT = 'direct' class-attribute instance-attribute

EXCLUSIVE = 'exclusive' class-attribute instance-attribute

SHARED = 'shared' class-attribute instance-attribute

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: str) -> ShareMode:
    return cls(json)

to_json()

Source code in zendriver/cdp/smart_card_emulation.py
def to_json(self) -> str:
    return self.value

StatusRequested dataclass

Fired when SCardStatus is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.statusRequested")
@dataclass
class StatusRequested:
    """
    Fired when ``SCardStatus`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa
    """

    request_id: str
    handle: int

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> StatusRequested:
        return cls(request_id=str(json["requestId"]), handle=int(json["handle"]))

handle: int instance-attribute

request_id: str instance-attribute

__init__(request_id, handle)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> StatusRequested:
    return cls(request_id=str(json["requestId"]), handle=int(json["handle"]))

TransmitRequested dataclass

Fired when SCardTransmit is called.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit

Source code in zendriver/cdp/smart_card_emulation.py
@event_class("SmartCardEmulation.transmitRequested")
@dataclass
class TransmitRequested:
    """
    Fired when ``SCardTransmit`` is called.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit
    """

    request_id: str
    handle: int
    data: str
    protocol: typing.Optional[Protocol]

    @classmethod
    def from_json(cls, json: T_JSON_DICT) -> TransmitRequested:
        return cls(
            request_id=str(json["requestId"]),
            handle=int(json["handle"]),
            data=str(json["data"]),
            protocol=Protocol.from_json(json["protocol"])
            if json.get("protocol", None) is not None
            else None,
        )

data: str instance-attribute

handle: int instance-attribute

protocol: typing.Optional[Protocol] instance-attribute

request_id: str instance-attribute

__init__(request_id, handle, data, protocol)

from_json(json) classmethod

Source code in zendriver/cdp/smart_card_emulation.py
@classmethod
def from_json(cls, json: T_JSON_DICT) -> TransmitRequested:
    return cls(
        request_id=str(json["requestId"]),
        handle=int(json["handle"]),
        data=str(json["data"]),
        protocol=Protocol.from_json(json["protocol"])
        if json.get("protocol", None) is not None
        else None,
    )

disable()

Disables the SmartCardEmulation domain.

Source code in zendriver/cdp/smart_card_emulation.py
def disable() -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Disables the ``SmartCardEmulation`` domain.
    """
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.disable",
    }
    json = yield cmd_dict

enable()

Enables the SmartCardEmulation domain.

Source code in zendriver/cdp/smart_card_emulation.py
def enable() -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Enables the ``SmartCardEmulation`` domain.
    """
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.enable",
    }
    json = yield cmd_dict

report_begin_transaction_result(request_id, handle)

Reports the result of a SCardBeginTransaction call. On success, this creates a new transaction object.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction

Parameters:

Name Type Description Default
request_id str
required
handle int
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_begin_transaction_result(
    request_id: str, handle: int
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the result of a ``SCardBeginTransaction`` call.
    On success, this creates a new transaction object.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaddb835dce01a0da1d6ca02d33ee7d861
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardbegintransaction

    :param request_id:
    :param handle:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["handle"] = handle
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportBeginTransactionResult",
        "params": params,
    }
    json = yield cmd_dict

report_connect_result(request_id, handle, active_protocol=None)

Reports the successful result of a SCardConnect call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta

Parameters:

Name Type Description Default
request_id str
required
handle int
required
active_protocol Optional[Protocol]

(Optional)

None
Source code in zendriver/cdp/smart_card_emulation.py
def report_connect_result(
    request_id: str, handle: int, active_protocol: typing.Optional[Protocol] = None
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardConnect`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4e515829752e0a8dbc4d630696a8d6a5
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardconnecta

    :param request_id:
    :param handle:
    :param active_protocol: *(Optional)*
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["handle"] = handle
    if active_protocol is not None:
        params["activeProtocol"] = active_protocol.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportConnectResult",
        "params": params,
    }
    json = yield cmd_dict

report_data_result(request_id, data)

Reports the successful result of a call that sends back data on success. Used for SCardTransmit, SCardControl, and SCardGetAttrib.

This maps to: 1. SCardTransmit PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit

  1. SCardControl PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol

  2. SCardGetAttrib PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib

Parameters:

Name Type Description Default
request_id str
required
data str
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_data_result(
    request_id: str, data: str
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a call that sends back data on success.
    Used for ``SCardTransmit``, ``SCardControl``, and ``SCardGetAttrib``.

    This maps to:
    1. SCardTransmit
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga9a2d77242a271310269065e64633ab99
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardtransmit

    2. SCardControl
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gac3454d4657110fd7f753b2d3d8f4e32f
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcontrol

    3. SCardGetAttrib
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacfec51917255b7a25b94c5104961602
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetattrib

    :param request_id:
    :param data:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["data"] = data
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportDataResult",
        "params": params,
    }
    json = yield cmd_dict

report_error(request_id, result_code)

Reports an error result for the given request.

Parameters:

Name Type Description Default
request_id str
required
result_code ResultCode
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_error(
    request_id: str, result_code: ResultCode
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports an error result for the given request.

    :param request_id:
    :param result_code:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["resultCode"] = result_code.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportError",
        "params": params,
    }
    json = yield cmd_dict

report_establish_context_result(request_id, context_id)

Reports the successful result of a SCardEstablishContext call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext

Parameters:

Name Type Description Default
request_id str
required
context_id int
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_establish_context_result(
    request_id: str, context_id: int
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardEstablishContext`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaa1b8970169fd4883a6dc4a8f43f19b67
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardestablishcontext

    :param request_id:
    :param context_id:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["contextId"] = context_id
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportEstablishContextResult",
        "params": params,
    }
    json = yield cmd_dict

report_get_status_change_result(request_id, reader_states)

Reports the successful result of a SCardGetStatusChange call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea

Parameters:

Name Type Description Default
request_id str
required
reader_states List[ReaderStateOut]
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_get_status_change_result(
    request_id: str, reader_states: typing.List[ReaderStateOut]
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardGetStatusChange`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga33247d5d1257d59e55647c3bb717db24
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardgetstatuschangea

    :param request_id:
    :param reader_states:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["readerStates"] = [i.to_json() for i in reader_states]
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportGetStatusChangeResult",
        "params": params,
    }
    json = yield cmd_dict

report_list_readers_result(request_id, readers)

Reports the successful result of a SCardListReaders call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa

Parameters:

Name Type Description Default
request_id str
required
readers List[str]
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_list_readers_result(
    request_id: str, readers: typing.List[str]
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardListReaders`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga93b07815789b3cf2629d439ecf20f0d9
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardlistreadersa

    :param request_id:
    :param readers:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["readers"] = [i for i in readers]
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportListReadersResult",
        "params": params,
    }
    json = yield cmd_dict

report_plain_result(request_id)

Reports the successful result of a call that returns only a result code. Used for: SCardCancel, SCardDisconnect, SCardSetAttrib, SCardEndTransaction.

This maps to: 1. SCardCancel PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel

  1. SCardDisconnect PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect

  2. SCardSetAttrib PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib

  3. SCardEndTransaction PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction

Parameters:

Name Type Description Default
request_id str
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_plain_result(
    request_id: str,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a call that returns only a result code.
    Used for: ``SCardCancel``, ``SCardDisconnect``, ``SCardSetAttrib``, ``SCardEndTransaction``.

    This maps to:
    1. SCardCancel
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gaacbbc0c6d6c0cbbeb4f4debf6fbeeee6
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardcancel

    2. SCardDisconnect
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga4be198045c73ec0deb79e66c0ca1738a
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scarddisconnect

    3. SCardSetAttrib
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga060f0038a4ddfd5dd2b8fadf3c3a2e4f
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardsetattrib

    4. SCardEndTransaction
       PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae8742473b404363e5c587f570d7e2f3b
       Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardendtransaction

    :param request_id:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportPlainResult",
        "params": params,
    }
    json = yield cmd_dict

report_release_context_result(request_id)

Reports the successful result of a SCardReleaseContext call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext

Parameters:

Name Type Description Default
request_id str
required
Source code in zendriver/cdp/smart_card_emulation.py
def report_release_context_result(
    request_id: str,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardReleaseContext`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#ga6aabcba7744c5c9419fdd6404f73a934
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardreleasecontext

    :param request_id:
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportReleaseContextResult",
        "params": params,
    }
    json = yield cmd_dict

report_status_result(request_id, reader_name, state, atr, protocol=None)

Reports the successful result of a SCardStatus call.

This maps to: PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382 Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa

Parameters:

Name Type Description Default
request_id str
required
reader_name str
required
state ConnectionState
required
atr str
required
protocol Optional[Protocol]

(Optional)

None
Source code in zendriver/cdp/smart_card_emulation.py
def report_status_result(
    request_id: str,
    reader_name: str,
    state: ConnectionState,
    atr: str,
    protocol: typing.Optional[Protocol] = None,
) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, None]:
    """
    Reports the successful result of a ``SCardStatus`` call.

    This maps to:
    PC/SC Lite: https://pcsclite.apdu.fr/api/group__API.html#gae49c3c894ad7ac12a5b896bde70d0382
    Microsoft: https://learn.microsoft.com/en-us/windows/win32/api/winscard/nf-winscard-scardstatusa

    :param request_id:
    :param reader_name:
    :param state:
    :param atr:
    :param protocol: *(Optional)*
    """
    params: T_JSON_DICT = dict()
    params["requestId"] = request_id
    params["readerName"] = reader_name
    params["state"] = state.to_json()
    params["atr"] = atr
    if protocol is not None:
        params["protocol"] = protocol.to_json()
    cmd_dict: T_JSON_DICT = {
        "method": "SmartCardEmulation.reportStatusResult",
        "params": params,
    }
    json = yield cmd_dict