This is an attempt to provide open source PKCS11 v2.40 module for Serbian ID smart cards produced by Gemalto. Module should provide at least functionalities that would enable user to log into state portals (like eUprava ili ePorezi).
The module is in the early development phase. All digest functions are implemented (except RIPEMD160), and the foundation for sign and verify functions is set up. Session and token management functions are generally implemented (except for login and logout). The biggest remaining task is the implementation of object management functions.
Functions for security officers are not planned for implementation (at least for now). These are not needed for end users, and the module is much simpler without them.
First, download PKCS11 headers:
OASIS_URL="https://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/os/include/pkcs11-v2.40"
curl --output include/pkcs11.h $(OASIS_URL)/pkcs11.h
curl --output include/pkcs11f.h $(OASIS_URL)/pkcs11f.h
curl --output include/pkcs11t.h $(OASIS_URL)/pkcs11t.h
Then run zig build
and you are good to go.
You will maybe need to configure PCSC lite path in build.zig
.
There is absolutely no warranty of any kind.
The code is released under the unlicense. You are free to do whatever you want with code.