Getting started
1 min read · Guides
Getting started
This guide walks through the fastest path to understanding CNML: install the packages, generate a sample certificate, and verify it.
Install the packages
CNML ships as npm packages under the @oiml scope. Install the ones
you need:
npm install @oiml/cnml-crypto # the verification pipeline
npm install @oiml/cnml-schemas # per-Recommendation JSON Schemas
npm install @oiml/cnml-xml # CNML XML parser and serializer
npm install @oiml/cnml-crypto # the verification pipeline
npm install @oiml/cnml-schemas # per-Recommendation JSON Schemas
npm install @oiml/cnml-xml # CNML XML parser and serializer
Or clone the repository for the full experience (web app, CA server, test vectors):
git clone https://github.com/oimlsmart/cnml.git
cd cnml
pnpm install
pnpm dev
git clone https://github.com/oimlsmart/cnml.git
cd cnml
pnpm install
pnpm dev
The dev server runs at http://localhost:4321/cnml/.
Try the web app
The web app at /cnml/app provides browser-based tools for
evaluation:
Generate a signing key at
/keys. The key is generated in your browser using WebCrypto, encrypted with a passphrase you choose, and stored in IndexedDB. It never leaves your machine.Create a certificate at
/create. Pick an OIML Recommendation (R60 for load cells, R76 for weighing instruments, etc.), fill in the evaluation results, and sign the CNML XML.Verify a certificate at
/verify. Drop a.cnml.xmlfile onto the verifier. The seven-check pipeline runs entirely in your browser.
Run the test vectors
The repository ships with 22 pre-signed test vectors (one per Recommendation). These exercise the full sign + verify pipeline:
pnpm vectors:gen # regenerate the vectors
pnpm vectors:verify # verify all 22 round-trip
pnpm vectors:gen # regenerate the vectors
pnpm vectors:verify # verify all 22 round-trip
Next steps
- Signing a certificate for the issuance flow.
- Verifying a certificate for the check pipeline.
- Schema-driven design for how the per-Recommendation forms work.