JavacardOS will not accept order any more, please contact our partner Feitian online Store:
https://ftsafe.en.alibaba.com/index.html

Compile pyGlobalplatform on Linux OS

pyGlobalPlatform is a open source python library of globalplatform client library.
User avatar
JavaCardOS
Posts: 273
Joined: Thu Apr 30, 2015 12:00 pm
Points :2405
Contact:

Compile pyGlobalplatform on Linux OS

Post by JavaCardOS » Wed Jan 13, 2016 2:14 am

Take Ubuntu for example.

1. Install cmake

Code: Select all

sudo apt-get install cmake


2. Install make

Code: Select all

sudo apt-get install automake


3.Install gcc

Code: Select all

sudo apt-get install gcc


4.Install g++

Code: Select all

sudo apt-get install g++


5. Enter pyGlobalPlatform source code directory. Execute cmake to generate Makefile
Note: Whether to execute step 2 to 3 is according to your own system situation.
You can of course execute the command of this step to install the corresponding tools your system lacks according to the system prompt.

6. Execute make command

Code: Select all

make
make install (Administrator permission required)


7. Enter python

Code: Select all

import pyglobalplatform as gp

c = gp.establishContext()
readername = gp.listReaders(c)[0]
ci = gp.connectCard(c, readername, 1)
selectCommand = '\x00\xA4\x04\x00\x00'
for i in xrange(1000):
      print ">> " + "".join("%02X" %(ord(v)) for v in selectCommand)
      print "<< " + "".join("%02X" %(ord(v)) for v in gp.GP211_send_APDU(c, ci, None, selectCommand))
gp.disconnectCard(c, ci)
gp.releaseContext(c)


Note:
1. Please be sure that you have already installed GlobalPlatform and gppcscconnectionplugin
2. If GlobalPlatform and gppcscconnectionplugin are installed under /usr/local/lib, you need to add LD_LIBRARY_PATH:

Code: Select all

 export LD_LIBRARY_PATH="/usr/lib;/usr/local/lib;"

3. If you have any problem, feel free to address them here!

liyan
Posts: 2
Joined: Sun Aug 11, 2019 1:29 am
Points :68
Contact:

Re: Compile pyGlobalplatform on Linux OS

Post by liyan » Tue Sep 10, 2019 12:15 am

how to do when install on macos


Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer