Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit e3a9372 · 11 days ago

IT in Uzbekistan, part 2: EDS and E-IMZO for developers — key, installation, website signature, and server verification

🌐 Machine-translated from Russian. Show original

How an electronic signature works in Uzbekistan and how to embed it into a web service: where to get the key, how to enter E-IMZO, how to sign data in a browser, and how to check the signature on your server via e-imzo-server.

⚖️ Rules are changing. The post is an overview of official sources for November 2026, not a legal or tax consultation. Before making a decision, check the current versions: lex.uz, it-park.uz, soliq.uz.

In this part:

How it works#

In Uzbekistan, the digital signature key is usually stored by the user: the .pfx file in the DSKEYSfolder, ID card, or token. The website itself does not work with the key. The signature is made by the E-IMZO program on the user's computer, and the site accesses it from JavaScript.

Diagram from the official integration instructions (qo0p/e-imzo-doc):

Браузер (ваш JS, CAPIWS) ──WebSocket──▶ E-IMZO на ПК пользователя (ключ .pfx / ID-карта / токен)
        │                                      │
        │  PKCS#7 (base64)                     └─ закрытый ключ не покидает ПК
        ▼
Ваш backend ──REST /backend/*──▶ e-imzo-server (Java) ──▶ vpn.e-imzo.uz:3443 (OCSP, штамп времени)

If you integrated with NCALayer in Kazakhstan, the logic is the same: the local application signs, the server verifies. Compare with the "EDS and NCALayer for Developers" series.

How a user can get a key#

According to the educational portal of the Central Bank of Uzbekistan finlit.uz:

  • the digital signature key is issued for two years;
  • it can be obtained at the public services center or online at e-imzo.uz (Registration Center at the tax authority) and through the my.gov.uz public services portal;
  • for an online application, the individual needs PINFL and a phone number registered to the applicant;
  • after approval, an SMS is received, the key is confirmed on the website and saved to the DSKEYSfolder;
  • Payment — a percentage of the base calculation amount (varies between individuals and legal entities). Check the current rate on the website when submitting.

The legal entity's key in the director's name is issued through the tax authority's office (e-imzo.soliq.uz). You can renew a valid key by logging into the office with the same key.

💡 Do not use the employee's private key for development. Request a test key or work in E-IMZO developer mode (see below).

Installing E-IMZO#

  1. Download E-IMZO from the official e-imzo.uz website. Do not take builds from chats and file-sharing services.
  2. Install and run. The program runs in the tray.
  3. Check that keys from DSKEYS, ID card, or token are visible in the E-IMZO window.
  4. Local API help opens at http://127.0.0.1:64646/apidoc.html — it is specified in the integration instructions.

Domain API key#

For a page to call E-IMZO, it needs an API-KEY bound to the domain:

  • the key is issued to one production domain; a separate key is required for the subdomain; the production key is not issued to the IP address;
  • For localhost and 127.0.0.1 , the instruction contains ready-made keys — only for local development;
  • for test domains, the E-IMZO tray menu includes "Developer Mode";
  • do not confuse API-KEY with the server VPN key and SiteID for mobile signature — these are different sets.

Signature in the browser#

The order of calls in JavaScript (libraries e-imzo.js and e-imzo-client.js are taken from the official package):

  1. CAPIWS.apikey([...domain, key...], ok, fail) — when the page loads. In E-IMZO v6, the key can be pulled automatically.
  2. User key list: list_all_certificates function (wrapper in e-imzo-client.js).
  3. load_key — the user enters the password, you get keyID. Keep it during the session: E-IMZO can remember the password for 6 hours.
  4. Signature — create_pkcs7.
// data — строка для подписи, keyId — из load_key
function signData(data, keyId) {
  return new Promise(function (resolve, reject) {
    CAPIWS.callFunction({
      plugin: "pkcs7",
      name: "create_pkcs7",
      // base64 данных, keyID ("idcard" для ID-карты), "no" — вложенная подпись, "yes" — отделенная
      arguments: [btoa(unescape(encodeURIComponent(data))), keyId, "no"]
    }, function (event, resp) {
      if (resp.success) resolve(resp.pkcs7_64);
      else reject(resp.reason);
    }, reject);
  });
}

For ID cards, "idcard"is given instead of keyID, and for tokens — "baikey" or "ckc".

Nested or detached signature. Attached contains the document inside PKCS#7 — convenient for short data and login. Detached is stored next to the file — convenient for large documents.

Login via EDS: challenge scheme#

1. Браузер → GET /frontend/challenge           (e-imzo-server, без кеширования!)
2. Браузер подписывает challenge в E-IMZO     → PKCS#7
3. Браузер → POST /login на ваш backend        (PKCS#7)
4. Backend → POST /backend/auth (e-imzo-server) с заголовками X-Real-IP и Host
5. status = 1 → берете из subjectCertificateInfo ПИНФЛ/ИНН и создаете сессию

Response codes /backend/auth: 1 — success; -1 — failed to check certificate status (often no VPN connection); -5 — time out of valid window; -10, -11, -12 — signature or certificate errors; -20 — challenge not found or expired.

Signature verification on the server#

e-imzo-server is a Java application (JRE 8) that checks signatures and certificate status. The official source of the distribution according to the instructions is the developer's Telegram channel; third-party Docker images are not recommended by the instruction.

Launching version 2.x:

java -Dfile.encoding=UTF-8 -jar e-imzo-server.jar start --config config.properties
curl http://127.0.0.1:8080/ping   # связь с VPN
curl http://127.0.0.1:8080/info   # версия и vpnKeyInfo

Main config.propertiesparameters: listen.ip, listen.port=8080, vpn.connect.host=vpn.e-imzo.uz, vpn.connect.port=3443, VPN key paths, truststore, and tsp.jks. There are testvpn.e-imzo.uz:2443for testing. Keep passwords secret, not in the repository.

Main REST methods#

MethodWhat isBody
GET /frontend/challengerandom input string—
POST /backend/authlogin via signed challengePKCS#7 base64
POST /frontend/timestamp/pkcs7add a timestampPKCS#7 base64
POST /backend/pkcs7/verify/attachedcheck the nested signaturePKCS#7 base64
POST /backend/pkcs7/verify/detachedto check the separate signatureдокумент_base64|pkcs7_base64
POST /frontend/pkcs7/joincombine two signatures (two signatories)pkcs7_1|pkcs7_2

Example of a backend call:

curl -s -X POST http://127.0.0.1:8080/backend/pkcs7/verify/attached \
  -H "X-Real-IP: 203.0.113.10" -H "Host: example.uz" \
  --data-binary @signed.p7b.b64

Nginx: what to close#

location /frontend/ { proxy_pass http://127.0.0.1:8080; proxy_no_cache 1; proxy_cache_bypass 1; }
location /backend/  { deny all; }   # только ваш backend ходит к e-imzo-server напрямую

If the server is in a container, it is convenient to elevate it next to the application in Docker Compose — see the series "Docker and CI/CD from scratch."

Mobile signature#

For an ID card via the E-IMZO Mobile app, e-imzo-server has /frontend/mobile/* and /backend/mobile/*methods. They are enabled only at a specified mobile.siteId. A common -99 error ("digest does not match") is double base64 encoding or another document.

What to check in the signature#

  1. The signature is mathematically correct — the document has not been changed.
  2. Certificate valid and not revoked at the moment of signatures.
  3. The entity matches the expected one: PINFL of the individual or the organization's TIN.
  4. For archives — a timestamp.
  5. Log every check: who, what, when, result.

Typical mistakes#

  • /frontend/challenge proxy is cached — the login breaks with the -20code.
  • /backend/* is available online.
  • No connection to vpn.e-imzo.uz — status check returns -1.
  • API-KEY is written to www., and the site is open without www (or vice versa).
  • Only the "signature is correct" is checked, without PINFL/TIN reconciliation.

Next — IT in Uzbekistan, part 3: online payment — Payme, Click, Uzum Bank, Uzcard, and Humo, API, and receipt fiscalization

Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.