Skip to main content

Python toolkit for LEIA smartcard reader

Project description

[![GitHub license](https://img.shields.io/github/license/h2lab/smartleia)](https://github.com/h2lab/smartleia/blob/master/LICENSE.bsd3) [![Debian package](https://img.shields.io/debian/v/smartleia/unstable)](https://tracker.debian.org/pkg/smartleia) ![Build status](https://github.com/h2lab/smartleia/actions/workflows/main.yml/badge.svg)

# SmartLeia

This repository holds the source of the python package used to drive the LEIA smartcard reader. With it, you will be able to:

  • Connect to the LEIA board

  • Choose parameters for the PSS/PTS negotiation

  • Send APDUs and receive the corresponding responses

  • Activate the DFU mode to download new firmware

  • Start a [Virtual SmartCard](https://frankmorgner.github.io/vsmartcard/) client to use LEIA as a real smartcard reader (through pcscd)

The smartleia package should be compatible with Python 3.6 and newer.

## Installation

### From apt

If you use debian or ubuntu, smartleia should be packaged (in the recent versions of the distros). Simply try:

`sh apt install smartleia `

### From git

You may need to use the last version of python builtin’s setuptools to install smartleia from git:

`sh python -m pip install --upgrade pip setuptools wheel `

`sh git clone https://github.com/h2lab/smartleia cd smartleia pip install --user .; `

## Using smartleia with PCSC

It is possible to use smartleia in a PCSC mode, where it communicates with the PCSC daemon so that you can use your existing tools (such as opensc) to communicate with the smartcard transparently. Using this mode will require the installation of vsmartcard-vpcd and vsmartcard-vpicc, either from the sources in the [vsmartcard](https://github.com/frankmorgner/vsmartcard) repository, or from your distro packages (this should be packaged in recent debian and ubuntu distros):

`sh apt install vsmartcard-vpcd vsmartcard-vpicc `

Then, you can lauch PCSC daemon in a terminal: `sh pcscd -fad `

And launch smartleia in PCSC relay mode: `sh python3 -m smartleia `

Of course, you should have your LEIA (or equivalent) board plugged in using USB as well as a smart card present in the connector. PCSC should spot a new ATR if everything went fine.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smartleia-1.0.2.tar.gz (25.8 kB view details)

Uploaded Source

Built Distribution

smartleia-1.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file smartleia-1.0.2.tar.gz.

File metadata

  • Download URL: smartleia-1.0.2.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for smartleia-1.0.2.tar.gz
Algorithm Hash digest
SHA256 76c86fd7c9fc1a8a5c2672d439df947ba535a806862bcd0d1c08a43309ef64b5
MD5 c6da39061f029f39e78cf3f2a423af5a
BLAKE2b-256 4b402b58bb63b5d8a2e1e85eb219c733230a69f3b0932b4ea7f1da18080720e6

See more details on using hashes here.

File details

Details for the file smartleia-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: smartleia-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for smartleia-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16090b1082106196d11e1987e541ce36e3dd6aa2899191c3f987d55ae12cce50
MD5 b786b286de03e75b7091c86d88e72f35
BLAKE2b-256 16b021fe4d067f67113d8b3e594be52be1178a1012967513dfafa14d259f4816

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page