Гостевой режим. Читать посты можно без регистрации. Комментарии, оценки, контакты вакансий и свои публикации откроются после регистрации и принятия правил. Что такое Коммит →

Редакция КоммитРедакция портала
commit ab5c4bc · 11 дней назад

Central Asia for engineers, part 4: digital signatures and e-government APIs — NCALayer, E-IMZO and Tunduk

In Central Asia a qualified digital signature is not an exotic feature: people sign tax reports, contracts and logins with it every day. If your product serves businesses in the region, sooner or later a customer asks "can we sign this with our key?". This part explains what a developer integrates in each country.

⚖️ Rules change. This post is an overview of official sources as of November 2026, not legal or tax advice. Before you act, check the current versions and talk to a local lawyer.

In this part:

The big picture#

KazakhstanUzbekistanKyrgyzstan
User's keyFile, token or ID card from the National Certification Authority (NCA RK); eGov MobileKey from the state CA; ID card; E-IMZO mobileCloud signature from Infocom; tokens
Browser bridgeNCALayer — local app, WebSocket on 127.0.0.1:13579E-IMZO — local app, WebSocket on 127.0.0.1Mostly server-side / cloud signature
Server-side checkKalkan SDK from NCA RK; OCSP, TSPE-IMZO-SERVER (REST)Through the CA's services
E-gov data exchangeSmart Bridge (sb.egov.kz)OneID for login; interagency platformsTunduk — national X-Road

The common rule in all three countries: the private key never leaves the user's device or the CA's cloud. Your web app asks a local or remote component to sign, and your server verifies the result.

Kazakhstan: NCALayer#

What it is. NCALayer is a desktop application from the National Certification Authority of Kazakhstan. It runs a local TLS server on 127.0.0.1:13579; web pages talk to it over a secure WebSocket. Downloads and docs are on pki.gov.kz.

Signing from the browser. The current module is kz.gov.pki.knca.basics with the method sign. A request looks like this (documented in the NCA's SDK wiki):

{
  "module": "kz.gov.pki.knca.basics",
  "method": "sign",
  "args": {
    "allowedStorages": ["PKCS12", "AKKZIDCardStore", "AKKaztokenStore"],
    "format": "cms",
    "data": "BASE64_OF_DOCUMENT",
    "signingParams": { "decode": true, "encapsulate": false, "tsaProfile": {} },
    "signerParams": { "extKeyUsageOids": ["1.3.6.1.5.5.7.3.4"] },
    "locale": "ru"
  }
}
  • format: cms for files and binary data, xml for XML documents (XMLDSig).
  • encapsulate: false gives a detached signature — store the document and the signature separately.
  • tsaProfile asks NCALayer to add a timestamp from the NCA's TSP service.
  • extKeyUsageOids limits which certificates the user can choose: signing vs authentication keys.

Verifying on the server.

  1. Check the signature mathematically and the certificate chain up to the NCA roots.
  2. Check revocation (OCSP or CRL) at the time of signing.
  3. Check the subject: the IIN and BIN in the certificate match the person and company that are supposed to sign.

The NCA provides the Kalkan SDK for Java and other platforms; the open-source NCANode wraps it in a REST API. The most common bug is skipping step 3: the signature is valid, but made by the wrong person.

E-government data. Commercial systems access government services through Smart Bridge (sb.egov.kz): you register with the company's signature key, pick a service from the catalogue and send a connection request to the data owner. Citizens' personal data is not available without their consent.

Deeper material for Kazakhstan: e-signatures in Kazakhstan (in Russian), e-signatures and NCALayer for developers (in Russian) and integrations with Kazakh government systems (in Russian).

Uzbekistan: E-IMZO and OneID#

What it is. E-IMZO is the signing application used with Uzbek digital signature keys. The official site is e-imzo.uz (it was not reachable from our test location while this article was being prepared — open it from Uzbekistan if you have problems). The details below come from a widely used community integration guide, qo0p/e-imzo-doc, and should be confirmed with the E-IMZO operator.

Browser side.

  • The local E-IMZO app listens on 127.0.0.1: wss://127.0.0.1:64443/service/cryptapi for HTTPS pages and ws://127.0.0.1:64646/service/cryptapi for HTTP. A local function reference is served at http://127.0.0.1:64646/apidoc.html.
  • Each production domain needs an API key issued by the E-IMZO operator; subdomains need their own keys, and keys are not issued for bare IP addresses. For test domains, the E-IMZO tray menu has a developer mode.
  • The flow: load the key (load_key) → sign with create_pkcs7 (attached or detached) → send PKCS#7 to your backend.

Server side — E-IMZO-SERVER. A Java service you run next to your backend. Typical login:

  1. Frontend gets a challenge: GET /frontend/challenge.
  2. The user signs the challenge in E-IMZO.
  3. Your backend sends the PKCS#7 to POST /backend/auth; the server checks the signature, the challenge and the certificate status.
  4. On success you create a session.

Expose only /frontend/* to browsers and keep /backend/* reachable from your backend only. The server also adds timestamps and verifies attached and detached signatures.

OneID is the state single sign-on (id.egov.uz). Users log in with a password, a digital signature or Mobile-ID. To integrate, you apply in the "For developers" section with your domain, redirect URI and server IP, and receive client credentials for an OAuth2-style flow. It is often easier than handling signatures yourself when you only need a verified identity.

Kyrgyzstan: Tunduk (X-Road) and cloud signatures#

Tunduk is the national data-exchange platform built on X-Road, the same technology Estonia uses. Official site: tunduk.gov.kg.

How a participant connects:

  1. Read the public offer agreement and submit a connection application signed by the organization's management.
  2. Prepare a server: Ubuntu 20.04 LTS (64-bit), static public IP, 8 GB RAM recommended, 80 GB free disk, support for hardware tokens.
  3. Buy a key carrier (smart card, USB token or HSM) and obtain two electronic signatures — for authentication and for signing.
  4. Install the security server from the Tunduk package repository; the Tunduk team helps with setup.
  5. Register your information system and services in the catalogue of solutions; the operator decides on connection.

Calling a service. Through your security server, a REST call follows the X-Road pattern:

curl -X GET "https://<your-security-server>/r1/<instance>/<class>/<member>/<subsystem>/<service>/v1" \
  -H "X-Road-Client: <instance>/<class>/<your-member>/<your-subsystem>"

Every request is signed and logged by both security servers — you get non-repudiation for free, but you also have to archive request logs and sign SLAs with other participants.

Signatures. Most citizens use a cloud electronic signature issued by the state enterprise Infocom; it is used to log in to the Tunduk portal and to sign documents in state services. Integration of signatures into third-party systems is arranged with Infocom (infocom.kg) — we did not find a public SDK.

Architecture: hide the country behind one interface#

If you serve all three countries, keep the signing logic behind a single interface and plug in providers:

interface SignatureProvider {
  country: "KZ" | "UZ" | "KG";
  // browser side: returns a detached CMS/PKCS#7 signature
  signInBrowser(data: Uint8Array): Promise<Uint8Array>;
  // server side: checks signature, chain, revocation, timestamp
  verify(data: Uint8Array, signature: Uint8Array): Promise<{
    valid: boolean;
    signerId: string;      // IIN / PINFL / PIN — store hashed if you only need matching
    organizationId?: string;
    signedAt?: string;     // from the timestamp, not from the client clock
  }>;
}

What to store for each signed document: the original bytes, the signature, the verification result with the timestamp and the certificate. Do not re-sign or "normalize" documents after signing.

Checklist#

Common mistakes#

  1. Trusting the client clock for the signing time instead of a TSP timestamp.
  2. Accepting any valid certificate without checking that the IIN/BIN or PINFL belongs to the expected signer.
  3. Hard-coding localhost ports and hostnames — make them configurable, the local apps change between versions.
  4. Planning e-government integration in weeks. Agreements, keys and approvals usually take longer than the code.

Previous: Central Asia for engineers, part 3: accepting payments — Kaspi, Halyk, Freedom Pay, Payme, Click, MBank and Elsom.

Sources#

Комментарии · 0

Комментариев пока нет.Войдите, чтобы комментировать, оценивать и видеть все комментарии.