Skip to content

benallard/pythoncard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PythonCard

(a.k.a JavaCard under PyPi)

This is a pure python version of the javacard operating system as found on javacard smartcards.

It does not provides much on his own beside the functionnalities of the Operating System, as such, it is often used in combination with others projects like CAPRunner (linked via .CAP files) or WebSCard (through CAPRunner or python versions of Applets).

Documentation on this project is better found as original JavaCard documentation (ask Google). The goal is to replication the exact same functionnalities. If your experience is other, please fill in a bug report. Please do the same for missing functionnalities. As for now, I only implemented the functionnalities I was needing during my various tests.

To use it, when writing your Applet, just replace the following Java construction:

import javacard.framework.Applet;

with:

from pythoncard.framework import Applet

As, so far I know, the javacard version are backward compatible, the goal is to provide a classic 3.0.1 version, while maintaining compatiblity with earlier version like 2.1.2.

PythonCard is dependant on pyDes and pyCrypto for cryptographic operations. The rest of the functionnalities will however work without those packages installed.

To install it, either put the necessary directories in your PYTHONPATH, or install it via PyPi:

$ pip install JavaCard 

To run the test try that:

$ python -m unittest discover test