
Central Asia for engineers, part 4: digital signatures and e-government APIs — NCALayer, E-IMZO and Tunduk
🌐 Machine-translated from Russian. Show original
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#
| Kazakhstan | Uzbekistan | Kyrgyzstan | |
|---|---|---|---|
| User's key | File, token or ID card from the National Certification Authority (NCA RK); eGov Mobile | Key from the state CA; ID card; E-IMZO mobile | Cloud signature from Infocom; tokens |
| Browser bridge | NCALayer — local app, WebSocket on 127.0.0.1:13579 | E-IMZO — local app, WebSocket on 127.0.0.1 | Mostly server-side / cloud signature |
| Server-side check | Kalkan SDK from NCA RK; OCSP, TSP | E-IMZO-SERVER (REST) | Through the CA's services |
| E-gov data exchange | Smart Bridge (sb.egov.kz) | OneID for login; interagency platforms | Tunduk — 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:cmsfor files and binary data,xmlfor XML documents (XMLDSig).encapsulate: falsegives a detached signature — store the document and the signature separately.tsaProfileasks NCALayer to add a timestamp from the NCA's TSP service.extKeyUsageOidslimits which certificates the user can choose: signing vs authentication keys.
Verifying on the server.
- Check the signature mathematically and the certificate chain up to the NCA roots.
- Check revocation (OCSP or CRL) at the time of signing.
- 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/cryptapifor HTTPS pages andws://127.0.0.1:64646/service/cryptapifor HTTP. A local function reference is served athttp://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 withcreate_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:
- Frontend gets a challenge:
GET /frontend/challenge. - The user signs the challenge in E-IMZO.
- Your backend sends the PKCS#7 to
POST /backend/auth; the server checks the signature, the challenge and the certificate status. - 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:
- Read the public offer agreement and submit a connection application signed by the organization's management.
- Prepare a server: Ubuntu 20.04 LTS (64-bit), static public IP, 8 GB RAM recommended, 80 GB free disk, support for hardware tokens.
- Buy a key carrier (smart card, USB token or HSM) and obtain two electronic signatures — for authentication and for signing.
- Install the security server from the Tunduk package repository; the Tunduk team helps with setup.
- 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#
- Signing happens on the user's side (local app, mobile app or CA cloud); no private keys on your servers.
- Server verifies chain, revocation, timestamp and the signer's identity.
- Test keys and test environments for each country are in place.
- API keys (E-IMZO) issued for every production domain and subdomain.
- National IDs in logs are masked (see Central Asia for engineers, part 2: data localization in Kazakhstan, Uzbekistan and Kyrgyzstan and a SaaS architecture for the region.
- For e-government data: a signed agreement and a registered service — Smart Bridge in Kazakhstan, Tunduk in Kyrgyzstan.
Common mistakes#
- Trusting the client clock for the signing time instead of a TSP timestamp.
- Accepting any valid certificate without checking that the IIN/BIN or PINFL belongs to the expected signer.
- Hard-coding localhost ports and hostnames — make them configurable, the local apps change between versions.
- Planning e-government integration in weeks. Agreements, keys and approvals usually take longer than the code.
Sources#
- Kazakhstan: pki.gov.kz, NCALayer connection check (port 13579), KNCA Basics module, Smart Bridge, NCANode
- Uzbekistan: e-imzo.uz, community E-IMZO integration guide, OneID
- Kyrgyzstan: Tunduk: how to become a participant, Tunduk wiki, X-Road documentation, Infocom
Comments · 0
No comments yet.Sign in to comment, rate and see all comments.