keylight-rust
Open-source Keylight licensing SDK for Rust — the
keylight library plus a keylight CLI (keylight-cli). Activate license
keys, verify signed leases offline, and gate features on entitlements.
Verified against the Keylight SP-0 conformance vectors (the crate passes
tests/conformance.rs).
Install
[]
= "0.1"
Not yet published to crates.io. Until then, use a git dependency:
[]
= { = "https://github.com/keylight-dev/keylight-rust" }
Quickstart (library)
use ;
This example runs against the public Keylight Notes demo tenant
(keylight-notes-demo, product notes) on the default host
https://api.keylight.dev.
Offline model
The signed v3 lease is the offline artifact: once activated, it's persisted
locally and every entitlement check reads from it without a network call. Call
refresh_if_needed() (or check_on_launch()) on launch and on relevant app
events to renew the lease when it's near expiry — there are no background
threads. Leases are verified with Ed25519 against the trusted keyset, allowing
300s of clock skew.
CLI usage
The keylight binary wraps the same library:
--fetch-keys pulls the tenant's trusted keyset from the server. Flags also
read from environment variables: KEYLIGHT_TENANT, KEYLIGHT_PRODUCT,
KEYLIGHT_SDK_KEY, and KEYLIGHT_BASE_URL (defaults to
https://api.keylight.dev).
Crates
| Crate | Description |
|---|---|
keylight |
The licensing library. |
keylight-cli |
The keylight command-line binary. |
demo-app |
Keylight Notes — a runnable example app. |
tauri-plugin-keylight |
Tauri plugin wrapping the SDK. |
License
MIT.