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
handle: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, 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
context_id: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, context_id)
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
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
ConnectionState
Bases: Enum
Maps to SCARD_* connection state values.
Source code in zendriver/cdp/smart_card_emulation.py
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
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
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
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
disposition: Disposition
instance-attribute
handle: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, handle, disposition)
from_json(json)
classmethod
Disposition
Bases: Enum
Indicates what the reader should do with the card.
Source code in zendriver/cdp/smart_card_emulation.py
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
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
disposition: Disposition
instance-attribute
handle: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, handle, disposition)
from_json(json)
classmethod
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
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
attrib_id: int
instance-attribute
handle: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, handle, attrib_id)
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
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
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
context_id: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, context_id)
Protocol
Bases: Enum
Maps to the SCARD_PROTOCOL_* values.
Source code in zendriver/cdp/smart_card_emulation.py
RAW = 'raw'
class-attribute
instance-attribute
T0 = 't0'
class-attribute
instance-attribute
T1 = 't1'
class-attribute
instance-attribute
from_json(json)
classmethod
ProtocolSet
dataclass
Maps to the SCARD_PROTOCOL_* flags.
Source code in zendriver/cdp/smart_card_emulation.py
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
to_json()
ReaderStateFlags
dataclass
Maps to the SCARD_STATE_* flags.
Source code in zendriver/cdp/smart_card_emulation.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 | |
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
to_json()
Source code in zendriver/cdp/smart_card_emulation.py
ReaderStateIn
dataclass
Source code in zendriver/cdp/smart_card_emulation.py
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
to_json()
ReaderStateOut
dataclass
Source code in zendriver/cdp/smart_card_emulation.py
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
to_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
context_id: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, context_id)
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
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
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
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
ShareMode
Bases: Enum
Maps to the SCARD_SHARE_* values.
Source code in zendriver/cdp/smart_card_emulation.py
DIRECT = 'direct'
class-attribute
instance-attribute
EXCLUSIVE = 'exclusive'
class-attribute
instance-attribute
SHARED = 'shared'
class-attribute
instance-attribute
from_json(json)
classmethod
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
handle: int
instance-attribute
request_id: str
instance-attribute
__init__(request_id, 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
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
disable()
Disables the SmartCardEmulation domain.
enable()
Enables the SmartCardEmulation domain.
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
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
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
-
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
-
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
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
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
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
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
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
-
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
-
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
-
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
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
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
|