class documentation
PCSCCard connection class. Handles connection with a card thru a PCSC reader.
Method | __del__ |
Destructor. Clean PCSC connection resources. |
Method | __init__ |
Construct a new PCSC card connection. |
Method | connect |
Connect to the card. |
Method | disconnect |
Disconnect from the card. |
Method | do |
Transmit a control command to the reader and return response. |
Method | do |
get an attribute |
Method | do |
Transmit an apdu to the card and return response apdu. |
Method | get |
Return card ATR |
Method | reconnect |
Reconnect to the card. |
Instance Variable | disposition |
Undocumented |
Instance Variable | hcard |
Undocumented |
Instance Variable | hcontext |
Undocumented |
Inherited from CardConnection
:
Method | __enter__ |
Enter the runtime context. |
Method | __exit__ |
Exit the runtime context trying to disconnect. |
Method | add |
Add a CardConnection observer. |
Method | add |
Add a status word exception class to be filtered. |
Method | control |
Send a control command and buffer. Internally calls doControl() class method and notify observers upon command/response events. Subclasses must override the doControl() class method. |
Method | delete |
Remove a CardConnection observer. |
Method | get |
return the requested attribute |
Method | get |
Return bit mask for the protocol of connection, or None if no protocol set. The return value is a bit mask of CardConnection.T0_protocol , CardConnection.T1_protocol , CardConnection.RAW_protocol , CardConnection.T15_protocol ... |
Method | get |
Return card connection reader |
Method | set |
Add an error checking chain. |
Method | set |
Set protocol for card connection. |
Method | transmit |
Transmit an apdu. Internally calls doTransmit() class method and notify observers upon command/response APDU events. Subclasses must override the doTransmit() class method. |
Class Variable |
|
protocol RAW (direct access to the reader) |
Class Variable |
|
protocol T=0 |
Class Variable |
|
protocol T=15 |
Class Variable |
|
protocol T=1 |
Instance Variable | defaultprotocol |
see setProtocol and getProtocol |
Instance Variable | errorcheckingchain |
see setErrorCheckingChain |
Instance Variable | reader |
reader name |
Inherited from Observable
(via CardConnection
):
Method | clear |
Undocumented |
Method | count |
Undocumented |
Method | delete |
Undocumented |
Method | has |
Undocumented |
Method | notify |
If 'changed' indicates that this object has changed, notify all its observers, then call clearChanged(). Each observer has its update() called with two arguments: this observable object and the generic 'arg'. |
Method | set |
Undocumented |
Instance Variable | changed |
Undocumented |
Instance Variable | obs |
Undocumented |
Inherited from Synchronization
(via CardConnection
, Observable
):
Instance Variable | mutex |
Undocumented |
Construct a new PCSC card connection.
Parameters | |
reader | the reader in which the smartcard to connect to is located. |
Connect to the card.
If protocol is not specified, connect with the default connection protocol.
If mode is not specified, connect with smartcard.scard.SCARD_SHARE_SHARED.
Transmit a control command to the reader and return response.
Parameters | |
control | control command |
command | command data to transmit (list of bytes) |
Returns | |
response are the response bytes (if any) |
get an attribute
Parameters | |
attrib | Identifier for the attribute to get |
Returns | |
response are the attribute byte array |
Transmit an apdu to the card and return response apdu.
Parameters | |
command | command apdu to transmit (list of bytes) |
protocol | the transmission protocol, from CardConnection.T0_protocol , CardConnection.T1_protocol , or CardConnection.RAW_protocol |
Returns | |
a tuple (response, sw1, sw2) where
|