Skip to content
Example of signing documents using Slovak eID (PAdES, CAdES)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
src
.gitignore
LICENSE
README.md

README.md

Slovak eID Sign Tool

Slovak eID Sign Tool is tool for listing certificates from Slovak eID card, signing PDF documents with CMS signature (adbe.pkcs7.detached not valid eIDAS PAdES) or signing file (.txt, .pdf, .png,...) to eIDAS CAdES-BASELINE-B ASiC-E container (.asice file).

This project aim to education PKCS#11 standard and document signing using Slovak eID.

SlovakEidSignTool is example project for signing PDFs using Slovak eID (eID with ZEP / KEP), designed for learning.

Used:

  • .Net Core 2.1 - multi-platform,
  • PKCS#11 Interop for communication with eID "driver" (or other hardware token),
  • iTextSharp library.
  • commandline for parsing command line arguments.

Prerequisites

  • .Net Core SDK for build,
  • Slovak eID card with ZEP certificate,
  • Driver for smart card reader (from Slovensko.sk),
  • Application eID klient (from Slovensko.sk).

Usage

Listing KEP certificates on eID

  1. Insert eID card to card reader.
  2. Run dotnet SlovakEidSignTool.dll list.
  3. Type BOK.

Listing encryption and authentication certificates on eID

  1. Insert eID card to card reader.
  2. Run dotnet SlovakEidSignTool.dll list --listEp.
  3. Type BOK.

Signing the Pdf file "Example.pdf"

  1. Insert eID card to card reader.
  2. Run dotnet SlovakEidSignTool.dll signPDF Example.pdf SignedPdf.pdf.
  3. Type BOK.
  4. Type ZEP PIN.

Signing the file into the CAdES ASiC-E container

  1. Insert eID card to card reader.
  2. Run dotnet SlovakEidSignTool.dll signCades example.txt text/plain SignedExample.asice (signing file, mime-type of signing file, output signature file).
  3. Type BOK.
  4. Type ZEP PIN.

Example on Windows 7 x86 with self-contained build:

Signed dcument

Signed dcument

Validation result in zep.disig.sk of CAdES signature:

Validation result in zep.disig.sk

Build

cd src/SlovakEidSignTool
dotnet publish -c Release

Or self-contained for Windows 7 (8,10..):

cd src/SlovakEidSignTool
dotnet publish -c Release -r win7-x86

Or self-contained for Ubuntu:

cd src/SlovakEidSignTool
dotnet publish -c Release -r ubuntu.16.10-x64

For more see .NET Core RID Catalog.

Read more:

  1. PKCS#11 Interop
  2. PKCS#11 X509Store
  3. Signing a PDF File Using Azure Key Vault
  4. Slovensko.sk
  5. Program description in Slovak language
  6. Creating an ASiC-E container manually

Validation services

  1. Slovak national ZEP validator
  2. zep.disig.sk - online signer and validator
  3. DDS validator
You can’t perform that action at this time.