harrison314 / SlovakEidSignTool

Example of signing documents using Slovak eID (PAdES, CAdES)
GNU Affero General Public License v3.0
6 stars 3 forks source link
dotnet eid eidas electronic-signatures slovakia

Slovak eID Sign Tool

Slovak eID Sign Tool is tool for listing certificates from Slovak eID card, signing PDF documents with PAdES signature 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 documents using Slovak eID (eID with EP / KEP), designed for education.

Used:

Prerequisites

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 -o SignedPdf.pdf.
  3. Type BOK.
  4. Type KEP PIN.

    Signing the file into the CAdES ASiC-E container

  5. Insert eID card to card reader.
  6. Run dotnet SlovakEidSignTool.dll signCades example.txt -o SignedExample.asice (signing file, output signature file).
  7. Type BOK.
  8. Type KEP PIN.

    Add signature to existing CAdES ASiC-E container

  9. Insert eID card to card reader.
  10. Run dotnet SlovakEidSignTool.dll addSignCades SignedExample.asice -o SignedExample_2s.asice
  11. Type BOK.
  12. Type KEP PIN.

    Add file and signature to existing CAdES ASiC-E container

  13. Insert eID card to card reader.
  14. Run dotnet SlovakEidSignTool.dll addSignCades SignedExample.asice additional.txt -o SignedExample_2s.asice
  15. Type BOK.
  16. Type KEP PIN.

Example on Windows 10 x64 with self-contained build:

Signed dcument

Signed dcument

Example on Windows 10 x64 with self-contained build and application PINs:

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