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:
- net 6.0 - multi-platform,
- PKCS#11 Interop for communication with eID "driver" (or other hardware token),
- iTextSharp library.
- commandline for parsing command line arguments.
- .Net Core SDK for build,
- Slovak eID card with KEP certificate,
- Driver for smart card reader (from Slovensko.sk),
- Application eID klient (from Slovensko.sk).
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll list
. - Type BOK.
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll list --listEp
. - Type BOK.
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll signPDF Example.pdf -o SignedPdf.pdf
. - Type BOK.
- Type KEP PIN.
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll signCades example.txt -o SignedExample.asice
(signing file, output signature file). - Type BOK.
- Type KEP PIN.
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll addSignCades SignedExample.asice -o SignedExample_2s.asice
- Type BOK.
- Type KEP PIN.
- Insert eID card to card reader.
- Run
dotnet SlovakEidSignTool.dll addSignCades SignedExample.asice additional.txt -o SignedExample_2s.asice
- Type BOK.
- Type KEP PIN.
Example on Windows 10 x64 with self-contained build:
Example on Windows 10 x64 with self-contained build and application PINs:
Validation result in zep.disig.sk of CAdES signature:
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.