Christmas is coming!

To celebrate the new year and thank for the support from all our dear customers, Christmas promotional activity is being held in JavaCardOS online store.

During the event, you can enjoy many promotional activities - High Discount on JavaCardOS products,Lucky Draw,Double forum Points.

Come to choose your own Christmas gift and try your luck now!

How to use pyGlobalPlatform to establish Secure Channel

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

How to use pyGlobalPlatform to establish Secure Channel

Postby JavaCardOS » Tue Nov 24, 2015 5:36 am

This demo shows how to use pyGlobalPlatform to establish secure channel.

Code: Select all

# Import the module
import globalplatformlib as gp

# Establish Context
context = gp.establishContext()

# Select the smartcard reader you want to connect
readernames = gp.listReaders(context)
readerName=readernames[0]

#Connect reader
cardInfo = gp.connectCard(context, readerName, gp.SCARD_PROTOCOL_Tx)

# Get SCP details
scp, scpi = gp.getSCPDetails(context, cardInfo)

# Mutual Authentication
securityInfo = gp.mutualAuthentication(context, cardInfo, gp.DEFAULT_KEY, gp.DEFAULT_KEY, gp.DEFAULT_KEY, gp.DEFAULT_KEY, 0, 0, scp, scpi, 0, 0)

# Release context
gp.releaseContext(context)

User avatar
Tolice
Posts: 26
Joined: Wed May 20, 2015 2:41 am
Points: 144
Contact:

Re: How to use pyGlobalPlatform to establish Secure Channel

Postby Tolice » Wed Dec 02, 2015 8:09 am

It is necessary to explain the type of each parameters of API function in pyGloablPlatform.

Otherwise, just look at this demo, it is difficult to understand the meaning of these API.


Return to “pyGlobalPlatform”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer