Menu

Tree [9ca551] master /
 History

HTTPS access


File Date Author Commit
 pyGlobalPlatform 2016-07-27 unknown unknown [fee45d] ADD: Add test code.
 README.md 2016-07-27 JavaCardOS JavaCardOS [9ca551] Update README.md
 pyGlobalPlatform-usage.png 2016-07-27 unknown unknown [fee45d] ADD: Add test code.
 pyGlobalPlatform.png 2015-11-23 unknown unknown [a75284] ADD: More README text.

Read Me

pyGlobalPlatform

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.

Dependencies

Open source project: GlobalPlatform

Usage:

Code

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)

Result

Usage

For more api usage examples, please visit pyGlobalPlatform Developer's Guide.

See GlobalPlatform Library API reference for more details about API.

Structure

Structure

  • 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.

Build

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.

Developer's Guide

Introduce the usage of library APIs. Visit: pyGlobalPlatform Developer's Guide

Discussions

If you have any questions, please visit: JavacardOS pyGlobalPlatform Discussions

Website

JavacardOS