Verify the runtime
Verify a Telys install offline — run telys runtime verify, then reproduce the release-manifest, artifact-hash, and license checks yourself with the telys.verify API.
Verify a Telys install offline two ways: the one-command CLI check to run after every install or upgrade, and the telys.verify API to gate the runtime in your own startup. Both run entirely offline, against public keys embedded in the wheel — no network, no key server.
Before you start
You need an SDK install and a provisioned runtime:
pipx install telys # or: pip install telys
telys login # provisions the signed runtime + licenseThe signed bundle lands under $TELYS_HOME/runtime/<platform>/ (default ~/.telys/runtime/<os>-<arch>/). Everything below reads from there.
Verify with the CLI
Verify with the API
The same checks import from telys.verify, so you can gate your own startup. verify_manifest and verify_license take inputs you read straight from the bundle; verify_artifact compares a file's SHA-256 to the value in the trusted manifest.
import datetime
import glob
import os
from telys.verify import (
release_public_key,
license_public_key,
verify_manifest,
verify_artifact,
verify_license,
sha256_file,
)
# Locate the single verified-install directory under $TELYS_HOME/runtime/.
home = os.environ.get("TELYS_HOME", os.path.expanduser("~/.telys"))
runtime_dir = glob.glob(os.path.join(home, "runtime", "*"))[0]
# The keys the SDK trusts (from the embedded PEMs).
release_pub = release_public_key()
license_pub = license_public_key()
# 1. Release manifest -> trusted manifest dict (RS256 / PKCS1v15 / SHA-256).
with open(os.path.join(runtime_dir, "telys_manifest.json"), "rb") as f:
manifest_bytes = f.read()
with open(os.path.join(runtime_dir, "telys_manifest.sig"), "rb") as f:
signature = f.read()
manifest = verify_manifest(manifest_bytes, signature) # raises if tampered
print(f"manifest OK: format_version={manifest['format_version']} platform={manifest['platform']}")
# 2. Artifact integrity -> compare each library's SHA-256, in constant time,
# to the value the verified manifest recorded for it.
lib = os.path.join(runtime_dir, "libty_runtime.dylib") # .so on Linux
verify_artifact(lib, expected_sha256) # from the manifest
print("artifact OK:", sha256_file(lib)[:16], "…")
# 3. Offline license -> claims dict; strict, no network, pins RS256, ver == 2.
with open(os.path.join(runtime_dir, "license.jwt")) as f:
license_jwt = f.read().strip()
now = int(datetime.datetime.now(datetime.timezone.utc).timestamp()) # verify_license wants a Unix int
claims = verify_license(license_jwt, now=now)
print("license OK:", claims["products"]["telys"]) # tier + featuresThe three functions map one-to-one onto the anchors:
verify_manifest
verify_manifest(manifest_bytes, signature, pubkey=None) -> dict
RS256 / PKCS#1 v1.5 + SHA-256 over the exact manifest bytes; returns the trusted manifest.
verify_artifact
verify_artifact(path, expected_sha256)
Recomputes SHA-256 and compares, in constant time, to the expected value; raises on mismatch.
verify_license
verify_license(token, pubkey=None, *, now, issuer=None, audience=None, product="telys") -> dict
Strict offline RS256; pins alg, rejects crit, checks iss/aud/ver == 2/exp + grace, reads products.telys.
Expected result
telys runtime verify exits 0 on a genuine install:
The API script prints one confirmation per anchor:
If verification fails, the CLI exits non-zero and the API raises: a tampered manifest fails at step 1, a swapped library at step 2, an expired or wrong-product license at step 3. See Signature verification failures.
Override the trust anchors
Point verification at keys of your own — for example a staging release key. These environment variables override the embedded defaults:
TELYS_RELEASE_PUBKEY / TELYS_RELEASE_PUBKEY_FILE
The release key used by verify_manifest / release_public_key().
TELYS_LICENSE_PUBKEY / TELYS_LICENSE_PUBKEY_FILE
The license key used by verify_license / license_public_key().
TELYS_LICENSE_ISSUER
The expected license iss.
TELYS_LICENSE_AUDIENCE
The accepted license aud (comma-separated).
Next steps
Next: understand what each check proves in Three trust anchors.
Last updated
Was this helpful?