uapki-integration

Integrates the UAPKI Ukrainian cryptography library for signing and verification in 1C native components.

Updated May 18, 2025
One-click install
npx skills add https://github.com/VSydorenko/SimplyAddinConnect --skill uapki-integration-vsydorenko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: uapki-integration
Source: https://github.com/VSydorenko/SimplyAddinConnect/tree/main/.claude/skills/uapki-integration
Command: npx skills add https://github.com/VSydorenko/SimplyAddinConnect --skill uapki-integration-vsydorenko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Integrating the UAPKI library (Ukrainian digital signature standards DSTU 4145/7564) into a 1C:Enterprise native component is error-prone: the core cannot sign with private keys by itself, key storage providers must load as separate runtime DLLs, and INIT silently reports success even when no provider loaded. This Skill encodes the correct architecture, call sequence, and known pitfalls so signing and verification work on the first attempt. ## Core Features & Use Cases - Correct JSON-API usage: Guides the process()/json_free() memory contract, the {method, parameters} request format, and checking errorCode == 0 as the only success signal. - Provider deployment patterns: Explains the cmProviders contract (dir + allowedProviders), the 7 mandatory CM-API exports, architecture-suffixed DLL names (cm-pkcs12_x64/x86), and the RCDATA resource self-delivery pattern with atomic deployment to %LOCALAPPDATA%. - Method flow and offline modes: Covers the INIT → OPEN → SELECT_KEY → SIGN → VERIFY → CLOSE → DEINIT sequence, offline/ignoreCertStatus options, and the RET_UAPKI_OFFLINE_MODE (4120) behavior. - Use Case: You need to sign a document with a .p12 key container from 1C. The Skill tells you to INIT once with an injected cmProviders config, verify result.countCmProviders to catch silent provider load failure, then OPEN, SELECT_KEY, and SIGN with CAdES-BES format. ## Quick Start Ask the assistant to show how to initialize UAPKI with the cm-pkcs12 provider and sign data from a PKCS#12 container, following the INIT through SIGN method sequence.

Frequently Asked Questions about uapki-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sign data with UAPKI from a PKCS#12 container?

Call INIT once with a cmProviders config pointing to the cm-pkcs12 DLL, then OPEN the .p12 storage with its password, SELECT_KEY by key ID, and SIGN with a signatureFormat such as CAdES-BES. Success is determined solely by errorCode == 0 in the JSON response.

Why does UAPKI INIT return errorCode 0 but signing fails?

UAPKI's setup_cm_providers ignores provider load failures and always returns RET_OK, so INIT reports success even when no provider loaded. Check result.countCmProviders in the INIT response against the expected provider count to detect this silent failure.

Can the UAPKI cm-pkcs12 provider be linked statically?

No. UAPKI has no static provider registry; providers load only at runtime via LoadLibrary from the cmProviders.dir path, resolving 7 mandatory CM-API symbols. The provider must remain a separate DLL, typically with an architecture suffix like cm-pkcs12_x64.

How do I free memory returned by UAPKI process()?

Always release the JSON string returned by process() with json_free(), never free() or delete. Copy the response into your own buffer first, then call json_free() immediately to avoid leaks on all code paths.

Does UAPKI support offline signing without OCSP or CRL access?

Yes. Set "offline": true in INIT parameters and "ignoreCertStatus": true in SIGN options, or use VERIFY in STRUCT mode for structural checks. Requesting online formats like CAdES-T offline returns error 4120 (RET_UAPKI_OFFLINE_MODE).

Can UAPKI sign with multiple keys in parallel threads?

No. Although SIGN and VERIFY are thread-safe, SELECT_KEY is global and only one key can be active at a time. To use a different key you must re-select it first, so parallel signing with distinct keys is impossible.