Announce two new product: SmartCard Reader Rockey200 and USB2.0 Extension Cable

ROCKEY 200 is a handy and portable USB Smart Card reader that can perform read/write operations on any ISO 7816-1/2/3/4 smart cards which are compatible with protocol T=0 and T=1.

USB2.0 Extension Cable With high speed USB 2.0 devices such as USB token ,USB Card Reader and so on.

Come to try it now!

How to use pyGlobalPlatform to establish Secure Channel

pyGlobalPlatform is a open source python library of globalplatform client library.
User avatar
JavaCardOS
Posts: 257
Joined: Thu Apr 30, 2015 12:00 pm
Points: 2253
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: 29
Joined: Wed May 20, 2015 2:41 am
Points: 172
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