Language
🐍 Python
Package
dojo-trust · import dojo.trust
Latest version
0.4.0 · 19 November 2026
Requires
Python ≥ 3.9
Dependencies
none
License
MIT
Language
🐘 PHP
Package
dojo/trust · Dojo\Trust
Latest version
0.4.0 · 19 November 2026
Requires
PHP ≥ 8.1
Dependencies
ext-json *, ext-openssl *
License
MIT

Works with: Python 3.9+, zero dependencies (stdlib only). PHP variant >= 8.1 with ext-json and ext-openssl (core).

Independent MikroTik Dojo project library: it is not MikroTik software nor is it approved by MikroTik. Test it in a lab first.

Installation and usage

Installation (Python)

pip install --index-url https://mikrotikdojo.com/en/pypi/<your-address>/simple/ dojo-trust

The library is installed with pip from the dojo index, using a personal URL reserved for dojo members. Joining is free: you only need your email.

Enter the dojo for free I am already registered

Usage example (Python)

from dojo.trust import (TrustStore, sample_store, example_chain,
                        example_roots, verify_chain)

# Dati demo inclusi: catena reale Let's Encrypt 2021 (leaf lencr.org -> R3)
chain, roots = example_chain(), example_roots()

# Store "legacy" senza ISRG Root X1, come iOS 9 / Android 7.0:
# DST Root CA X3 scade il 2021-09-30
legacy = TrustStore.from_dict({
    "os": "sample", "version": "legacy",
    "roots": [r for r in sample_store().roots
              if r["name"] == "DST Root CA X3"],
})
res = verify_chain(chain, legacy, at="2021-09-01", extra_roots=roots)
print(res.verdict)   # trusted
res = verify_chain(chain, legacy, at="2021-10-01", extra_roots=roots)
print(res.verdict)   # not-trusted
print(res)           # motivazioni: DST Root CA X3 scaduto al 2021-10-01

# Con un trust store reale per versione OS (JSON, vedi README):
# store = TrustStore.load("stores/apple/ios10.json")
# res = verify_chain(open("chain.pem").read(), store, at="2021-10-01",
#                    extra_roots=roots)
# print(res.verdict)  # trusted: ISRG Root X1 e' nello store da iOS 10

Installation (PHP)

composer config repositories.dojo composer https://mikrotikdojo.com/en/composer/<your-address>/
composer require dojo/trust

The library is installed with Composer from the dojo repository, using a personal URL reserved for dojo members. Joining is free: you only need your email.

Enter the dojo for free I am already registered

Usage example (PHP)

use Dojo\Trust\TrustStore;
use Dojo\Trust\Verifier;

// Dati demo inclusi: catena reale Let's Encrypt 2021 (leaf lencr.org -> R3)
$chain = file_get_contents('data/example-chain.pem');
$roots = file_get_contents('data/example-roots.pem');
$full  = TrustStore::load('data/sample-store.json');

// Store "legacy" senza ISRG Root X1, come iOS 9 / Android 7.0:
// DST Root CA X3 scade il 2021-09-30
$legacy = TrustStore::fromArray([
    'os' => 'sample', 'version' => 'legacy',
    'roots' => array_values(array_filter($full->roots,
        fn($r) => $r['name'] === 'DST Root CA X3')),
]);
$res = Verifier::verifyChain($chain, $legacy, '2021-09-01', $roots);
echo $res['verdict'];   // trusted
$res = Verifier::verifyChain($chain, $legacy, '2021-10-01', $roots);
echo $res['verdict'];   // not-trusted
print_r($res['paths']); // motivazioni: DST Root CA X3 scaduto al 2021-10-01

// Con un trust store reale per versione OS (JSON, vedi README):
// $store = TrustStore::load('stores/apple/ios10.json');
// $res = Verifier::verifyChain(file_get_contents('chain.pem'), $store,
//     '2021-10-01', $roots);
// echo $res['verdict']; // trusted: ISRG Root X1 e' nello store da iOS 10

What it does

dojo.trust answers a question normal TLS clients never ask: “was this certificate chain trusted by that OS version, on that date?”. It is the tool to understand and reproduce the historical cases where a perfectly working site becomes “not secure” on millions of already-deployed devices, with no change on the server side.

The classic example: DST Root CA X3 / Let’s Encrypt (September 2021). The DST Root CA X3 root expired on 2021-09-30. Let’s Encrypt reached older devices through a cross-sign on that root; devices with ISRG Root X1 in their store (iOS 10+, Android 7.1.1+) had an alternative anchor, the others did not. With dojo.trust you prove it with a real chain and two dates:

verify_chain(chain, store_ios9, at="2021-09-01") → trusted; verify_chain(chain, store_ios9, at="2021-10-01") → not-trusted, with the exact reason (“DST Root CA X3: expired/not valid at 2021-10-01”). On iOS 10+ it stays trusted afterwards. The package ships demo data (a real 2021 lencr.org leaf chain + a store with ISRG Root X1 and DST Root CA X3) so you can try it immediately, with nothing to download.

What it does: PEM/DER certificate parsing (subject, issuer, serial, validity, SAN, EKU, basicConstraints, embedded SCTs); cryptographic verification of RSA PKCS#1 v1.5 (SHA-1/256/384/512) and ECDSA P-256/P-384 signatures; leaf → root path building inside a JSON trust store, including cross-signs and multiple paths; a trusted / not-trusted / ask verdict at the requested date with per-path reasons; documented extra-store rules for Apple (SHA-2, RSA ≥ 2048, SAN dNSName, serverAuth EKU, validity ≤ 825 days, Certificate Transparency) and Windows (root EKU in the Microsoft program).

Trust stores are JSON files with the root fingerprints per OS version: you build them from official sources (Apple “List of available trusted root certificates” pages, the AOSP platform/system/ca-certificates repository per Android tag, the CCADB report of the Microsoft Trusted Root Program). The format is documented in the README and also supports the blocked (blocklist) and always-ask statuses, plus serial+name matching for legacy Apple pages without fingerprints.

What it does not do: it is not a TLS client, it does not check revocation (CRL/OCSP), it does no hostname matching, and it does not support Ed25519/DSA. Validity is evaluated at day granularity (UTC); the Apple rules are a documented simplification of the official policies, with sources cited in the code.

Two implementations, same API and same verdicts (parity verified case by case): Python 3.9+ (stdlib only) and PHP 8.1+ (ext-openssl, a core extension) — both with zero external dependencies, MIT license. The Python package also ships a CLI: python -m dojo.trust --demo for the DST X3 demo, or --chain ... --store ... --date ... for your own chains.

Versions

VersionNewsFile
0.4.0 PHP latest
19 November 2026

0.4.0 — OS stores bundled (Apple / Android / Windows). Beyond the RouterOS factory stores, the package now bundles per-OS-version trust stores: 10 Android (AOSP base, 7.0→15), 24 Apple (iOS/macOS, including the ios17.4-macos14.4 boundary) and Windows (CCADB list, 550 roots with EKU). New accessors: TrustStore::android(), apple(), windows(), osStore(), android_versions()/apple_versions()/os_families(), plus the osRootPem() pool with the root DER bytes to close the paths (extra_roots). Measured real case: the Sectigo R46 root is absent in Android 13/14 and iOS 17.0, present from Android 15 and iOS 17.4 — "valid" doesn't mean "trusted". No API break.

  • dojo-trust-0.4.0.zip 1.2 MB
    sha256 115e632708bbf9a896a4ade943a48d3c52a2a7edc02571a0e1669144d692cffc
    .ots · confirmed in Bitcoin block 976,624
    🔏 GPG verification valid MikroTik Dojo signature · signed on 20 November 2026

    Key fingerprint:
    337F B37B 9464 B4A1 15F5 CDE7 5DD1 F777 F630 1B89

    dojo-trust-0.4.0.zip.asc · public key · how to verify

    gpg --verify dojo-trust-0.4.0.zip.asc dojo-trust-0.4.0.zip
0.4.0 Python latest
19 November 2026

0.4.0 — OS stores bundled (Apple / Android / Windows). Beyond the RouterOS factory stores, the package now bundles per-OS-version trust stores: 10 Android (AOSP base, 7.0→15), 24 Apple (iOS/macOS, including the ios17.4-macos14.4 boundary) and Windows (CCADB list, 550 roots with EKU). New accessors: android_store(), apple_store(), windows_store(), os_store(), android_versions()/apple_versions()/os_families(), plus the os_root_pem() pool with the root DER bytes to close the paths (extra_roots). Measured real case: the Sectigo R46 root is absent in Android 13/14 and iOS 17.0, present from Android 15 and iOS 17.4 — "valid" doesn't mean "trusted". No API break.

  • dojo_trust-0.4.0-py3-none-any.whl 1.2 MB
    sha256 558e74230623b0514fde93759ddcb259905a1c48612cd34e70a95a4830d495da
    .ots · confirmed in Bitcoin block 976,624
    🔏 GPG verification valid MikroTik Dojo signature · signed on 20 November 2026

    Key fingerprint:
    337F B37B 9464 B4A1 15F5 CDE7 5DD1 F777 F630 1B89

    dojo_trust-0.4.0-py3-none-any.whl.asc · public key · how to verify

    gpg --verify dojo_trust-0.4.0-py3-none-any.whl.asc dojo_trust-0.4.0-py3-none-any.whl
  • dojo_trust-0.4.0.tar.gz 1.2 MB
    sha256 9a7868afd2734ba819194e6ccc8bcffbdfecc4043bf381442fa1cd8ee3b99207
    .ots · confirmed in Bitcoin block 976,624
    🔏 GPG verification valid MikroTik Dojo signature · signed on 20 November 2026

    Key fingerprint:
    337F B37B 9464 B4A1 15F5 CDE7 5DD1 F777 F630 1B89

    dojo_trust-0.4.0.tar.gz.asc · public key · how to verify

    gpg --verify dojo_trust-0.4.0.tar.gz.asc dojo_trust-0.4.0.tar.gz
Previous versions (8, superseded)

They remain downloadable, with their fingerprint and OpenTimestamps proof, for anyone who pinned a version in their project. Use the latest: GPG signatures are only on the current versions.

VersionNewsFile
0.3.0 PHP
19 November 2026

0.3.0 — localized messages (it/en), English by default. Like the Python variant: verdict messages and readable errors are localizable, default English. Switch with I18n::setLang("it") or per call via the trailing lang argument of Verifier::verifyChain($chain, $store, $at, $extraRoots, $purpose, "it"). Data and verdict codes unchanged; README in English. No API break.

  • dojo-trust-0.3.0.zip 46.6 KB
    sha256 35f615183c551a5d6e2f05f973a5c7dca03cbe08657f5a6ce772d648f740eb89
    .ots · confirmed in Bitcoin block 976,596
0.3.0 Python
19 November 2026

0.3.0 — localized messages (it/en), English by default. The human-readable verdict messages (problems and reason) and readable errors are now localizable. The default language is English; switch to Italian with set_lang("it") (session default) or per call with verify_chain(..., lang="it"). Structured data (dicts, bytes, fingerprints) and the verdict codes (trusted/not-trusted/ask) are unchanged. The package README is now in English. No API break: lang is optional and trailing.

  • dojo_trust-0.3.0-py3-none-any.whl 48.3 KB
    sha256 38969094998ca4f6bef5bde842250ec38457914270fc7205306048d5860ebec5
    .ots · confirmed in Bitcoin block 976,596
  • dojo_trust-0.3.0.tar.gz 40.4 KB
    sha256 531b824abac87fa7bb94bf2bb761431ec327515ed80c97c13c4184f0d8dca844
    .ots · confirmed in Bitcoin block 976,596
0.2.0 PHP
18 November 2026

0.2.0 — RouterOS trust-store family (twin of the Python library). dojo/trust now ships RouterOS's factory trust stores, extracted from the .npk firmware with dojo/npk: the roots the router trusts as a TLS client (ACME client, /tool fetch check-certificate, e-mail, cloud). New methods TrustStore::routeros("7.25") and TrustStore::routerosVersions(); stores bundled for 7.18→7.25 (the same JSON as Python, identical data). Measured on the firmware: up to and including 7.18 (and all of 6.x) RouterOS had no factory store; it is born in 7.19 (26 roots), 27 from 7.20. The package now also ships the data/ folder. No API break.

  • dojo-trust-0.2.0.zip 48.5 KB
    sha256 eeb02fc4a51f765a52f5f3865fdb2054cfd32aee0110c47bddcbadd67cdcd1a8
    .ots · confirmed in Bitcoin block 976,462
0.2.0 Python
18 November 2026

0.2.0 — a new trust-store family: RouterOS. On top of the Apple/Android/Windows stores, dojo.trust now ships RouterOS's factory trust stores, extracted from the .npk firmware with dojo.npk: the roots the router trusts when it acts as a TLS client (ACME client, /tool fetch check-certificate, e-mail, cloud). New helpers routeros_store("7.25") and routeros_versions(); stores bundled for 7.18→7.25. Measured on the firmware: up to and including 7.18 (and all of 6.x) RouterOS had no factory store at all; it is born in 7.19 (26 roots), 27 from 7.20, and it evolves (7.22→7.25: a Go Daddy root out, SSL.com Root ECC in). Ships tools/gen_routeros_store.py to regenerate the stores from firmware. No API break.

  • dojo_trust-0.2.0-py3-none-any.whl 46.5 KB
    sha256 f42dbe31a8f13ca95b4173f64346630ed2dc1209d8df630e947be544954c7cf2
    .ots · confirmed in Bitcoin block 976,462
  • dojo_trust-0.2.0.tar.gz 38.2 KB
    sha256 3dbe5d2e43307888513f6a90aeb8be2c8bd09fc601038eeb57555c8ddfea68ea
    .ots · confirmed in Bitcoin block 976,462
0.1.1 PHP
18 November 2026

0.1.1 — security fix (twin of the Python library): path building now enforces a valid signature on every link, not just the last one. Namespace Dojo\Trust.

  • dojo-trust-0.1.1.zip 18.7 KB
    sha256 b68f57c3eca6a65720ff9b3132e8a30ce578bf7749ebeb3313a7f4db394c2701
    .ots · confirmed in Bitcoin block 976,433
0.1.1 Python
18 November 2026

0.1.1 — security fix. Path building now requires a valid signature on every link of the chain, not just the last one: before, an invalid leaf ← intermediate signature could be reported as «trusted» when the intermediate ← root link was valid and the root was in the store. Added a regression test. No API change.

  • dojo_trust-0.1.1-py3-none-any.whl 28.6 KB
    sha256 c28943796ca2a179a0736b5b0404a6e972b994e27060d63cbc5a959c92e72017
    .ots · confirmed in Bitcoin block 976,433
  • dojo_trust-0.1.1.tar.gz 32.3 KB
    sha256 61fb4bc5c8cfdb183596938736dadebdf83a837fcd45e1a36d19c364230a207d
    .ots · confirmed in Bitcoin block 976,433
0.1.0 PHP
17 November 2026

First public release (PHP). Namespace Dojo\Trust, requires PHP 8.1+ with ext-json and ext-openssl (core extensions). Same verdicts as the Python variant.

  • dojo-trust-0.1.0.zip 30.1 KB
    sha256 f6092f9ee3d0d374f8957a40c48d6d7f6ab5b6db41ac298a07f192a9890a2e58
    .ots · confirmed in Bitcoin block 976,325
0.1.0 Python
17 November 2026

First public release (Python).

  • dojo_trust-0.1.0-py3-none-any.whl 28.6 KB
    sha256 2d9c66539725537b389ed42a019d482bf9b02f8e2e71f0b037824ede86eb25b3
    .ots · confirmed in Bitcoin block 976,325
  • dojo_trust-0.1.0.tar.gz 31.9 KB
    sha256 722f9c737761021d97a845666f4ca59befa25647f26fe8ef1f2fb19d853e007f
    .ots · confirmed in Bitcoin block 976,325

Each file has its SHA-256 fingerprint (pip and Composer check it automatically) and an OpenTimestamps proof registered on Bitcoin: anyone can verify that the file is the one published on that date. Signed files also carry the MikroTik Dojo GPG signature: it says who published them, OpenTimestamps says when. Key and instructions → Files are downloaded only if you are in the dojo.

How-tos that use it