A tiny alternative to JSC "IIT" web-widget for verifying the user's signature of the Certification Authority
Verify PAdES and CAdES digital signatures using DSTU 4145-2002.
1. Download latest UAPKI
$ curl -L -o uapki-v2.0.12-linux-amd64.tar.gz https://github.com/specinfo-ua/UAPKI/releases/download/v2.0.12/uapki-v2.0.12-linux-amd64.tar.gz$ tar -xzf uapki-v2.0.12-linux-amd64.tar.gz
$ cd uapki-v2.0.12-linux-amd64$ cp libuapki.so.2.0.12 libuapkic.so.2.0.12 libuapkif.so.2.0.12 ~/.../IIT-Signature
$ cd ~/.../IIT-Signature
$ ln -sf libuapkic.so.2.0.12 libuapkic.so.2
$ ln -sf libuapkif.so.2.0.12 libuapkif.so.2A similar approach can also be performed on macOS and Windows systems.
$ pip install -r requirements.txt- Run the script:
$ python verify.py -h
usage: verify.py [-h] file [cms]
Verify PAdES and CAdES digital signatures using DSTU 4145-2002
positional arguments:
file Path to the PDF (.pdf) or enveloped CMS (.p7s) signature
cms Path to the detached CMS (.p7s) signature (optional)
options:
-h, --help show this help message and exit[*] Detected: CAdES format (detached)
[*] Fetching certificates from Central Certification Authority...
[*] Found 298 certificate(s) within CCA
[*] Signature verification successful
[*] Subject:
common_name = Ткаченко Мар'яна Іванівна
surname = Ткаченко
given_name = Мар'яна Іванівна
serial_number = TINUA-1234567890
country_name = UA
[*] RNOKPP or passport number of a citizen of Ukraine = 1234567890
[*] UNZR = 19910824-00026
[*] Issuer:
organization_name = ДП "ДІЯ"
common_name = "Дія". Кваліфікований надавач електронних довірчих послуг
serial_number = UA-43395033-1000
country_name = UA
locality_name = Київ
organization_identifier = NTRUA-43395033
[*] Signing Time: 2025-08-24 00:00:00
[*] Signature Algorithm: Dstu4145WithGost34311pb
[*] Signature Format: CAdES-BES
- Adjust library version numbers if you download a different UAPKI version.
- You need to set up a Python virtual environment for proper use with macOS.
- Cached trusted certificates are automatically handled to speed up repeated verifications.
- Support for the protocol for the creation and verification of advanced electronic signatures, as well as for the XAdES (XML signatures) format, is planned for future updates.