Page 1 of 1

How to use pyGlobalPlatform to establish Secure Channel

Posted: Tue Nov 24, 2015 5:36 am
by JavaCardOS
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)

Re: How to use pyGlobalPlatform to establish Secure Channel

Posted: Wed Dec 02, 2015 8:09 am
by Tolice
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.

Re: How to use pyGlobalPlatform to establish Secure Channel

Posted: Thu May 27, 2021 10:24 am
by SelmaAdam
I like video tutorials, whether recorded or live, are important as they add another dimension to learning that makes a student's educational experience more effective.