Skip to main content

pyHanko plugin for Slovenian eOI cards

Project description

Introduction

This package provides a plugin for pyHanko’s PDF signing CLI. The implementation is a very thin convenience wrapper around the PKCS#11 functionality included within the “core” pyHanko library.

Installation

Assuming you are installing with pip, running pip install pyhanko-eoi-plugin will install both pyHanko and the plugin. If you already have a working pyHanko install, take care to ensure that the plugin is installed in the same Python environment.

PyHanko makes use of Python’s package entry point mechanism to discover plugins, so installing both side-by-side should suffice. To test whether everything works, run pyhanko sign addsig and verify that eoi appears in the list of subcommands.

Installation troubleshooting

If you’re having issues getting the plugin autodection to work, you can also add the following snippet to your PyHanko configuration file:

plugins:
  - pyhanko_eoi.cli:EOIPlugin

This will work as long as you ensure that pyhanko_eoi is importable.

Signing a PDF file using a Slovenian eOI card

To sign a PDF file using your eOI card and pyHanko’s CLI (with this plugin), use the eoi subcommand to addsig, with the --lib parameter to tell pyHanko where to look for the eOI PKCS#11 library.

On Linux, it is named opensc-pkcs11.so and can usually be found under /usr/lib or /usr/local/lib. On macOS, it is named opensc-pkcs11.dylib, and can similarly be found under /usr/local/lib. The Windows version is typically installed to C:\Windows\System32 and is called opensc-pkcs11.dll.

On Linux, this boils down to the following:

pyhanko sign addsig --field Sig1 eoi --user-pin 12345 \
    --lib /path/to/opensc-pkcs11.so input.pdf output.pdf

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

pyhanko-eoi-plugin-0.1.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

pyhanko_eoi_plugin-0.1.1-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

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