| Home | Trees | Indices | Help |
|
|---|
|
|
The Session object enables programmers to transmit APDU to smartcards.
This is an example of use of the Session object:
import smartcard reader=smartcard.listReaders() s = smartcard.Session(reader[0]) SELECT = [0xA0, 0xA4, 0x00, 0x00, 0x02] DF_TELECOM = [0x7F, 0x10] data, sw1, sw2 = s.sendCommandAPDU(SELECT+DF_TELECOM) print data, sw1, sw2 s.close() print `s`
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Session constructor. Initializes a smart card session and
connect to the card.
readerName: reader to connect to; default is first PCSC reader
cardServiceClass: card service to bind the session to; default
is None
|
Close the smartcard session. Closing a session will disconnect from the card. |
Send an APDU command to the connected smartcard.
command: list of APDU bytes, e.g. [0xA0, 0xA4, 0x00, 0x00, 0x02]
returns a tuple (response, sw1, sw2) where
response is the APDU response
sw1, sw2 are the two status words
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sat Nov 22 15:23:53 2014 | http://epydoc.sourceforge.net |