pyGlobalPlatform is a open source python globalplatform client library. It is depend on the GlobalPlatform project. Using this library, you can use all features of GlobalPlatform project use Python programming language.
Open source project: GlobalPlatform
from pyGlobalPlatform import globalplatformlib as gp
context = gp.establishContext()
readers = gp.listReaders(context)
print 'List readers:'
for i in range(len(readers)):
reader = readers[i]
print ' %d - ' %(i) + reader
reader = 'Feitian R502 Contactless Reader 0'
print 'Connect to reader: ' + reader
connection = gp.connectCard(context, reader, gp.SCARD_PROTOCOL_T1)
cmd = '\x00\xA4\x04\x00\x00'
print '>> ' + ''.join('%02X' %(ord(b)) for b in cmd)
rsp = gp.sendApdu(context, connection, None, '\x00\xA4\x04\x00\x00')
print '<< ' + ''.join('%02X' %(ord(b)) for b in rsp)
For more api usage examples, please visit pyGlobalPlatform Developer's Guide.
See GlobalPlatform Library API reference for more details about API.
- Opensource project GlobalPlatform: The implementation of GlobalPlatform functions.
- pyGlobalPlatform-pyd: python objects to C data types conversion.
- pyGlobalPlatform-py(globalplatformlib): Define python API prototype, constants.
- GlobalPlatform Client Applications: Implemention of some GP tools using python programming language.
Provide cmake script, this project can be compiled for use on both windows and linux platform. For more details, please visit our forum JavacardOS pyGlobalPlatform Discussions.
Introduce the usage of library APIs. Visit: pyGlobalPlatform Developer's Guide
If you have any questions, please visit: JavacardOS pyGlobalPlatform Discussions