Expand description
§Licers
License-key verification for Rust apps, against the Licers service. Every answer is Ed25519-signed with your account key and checked here, with a fresh nonce per call, so a fake or replayed license server is refused.
use licers::LicenseClient;
let client = LicenseClient::builder("YOUR_PUBLIC_KEY")
.product_id("YOUR_PRODUCT_ID")
.app_version(env!("CARGO_PKG_VERSION"))
.build()?;
let result = client.validate("XXXX-XXXX-XXXX-XXXX")?;
if !result.valid {
eprintln!("Not licensed: {}", result.error.unwrap_or_default());
std::process::exit(1);
}
if result.feature("pro") == Some(&serde_json::json!(true)) {
// unlock pro features
}The API is blocking (no async runtime needed). From async code, call it
inside spawn_blocking.
Re-exports§
pub use serde_json;
Structs§
- Client
Builder - Builder for
LicenseClient. - Floating
Session - A held floating seat, heartbeated on a background thread. The seat can be
lost while your code runs — check
FloatingSession::activeor callFloatingSession::ensure_activeat safe points. Loss is decided from signed evidence only; an unreachable server keeps the seat only until its last signed expiry. Dropping the session releases the seat. - Lease
- License
Client - Verifies license keys against a Licers server. Every answer the app relies on is Ed25519-signed with your account key and checked here, with a fresh nonce each call, so a fake or replayed server response is refused.
- SignIn
- A sign-in waiting for the customer, from
LicenseClient::start_sign_in. - Update
Info - Usage
- A key’s credit balance, from a signed answer.
- Validation
Result - Outcome of
LicenseClient::validate.
Enums§
- Error
- Every error the SDK returns.
- Heartbeat
State
Constants§
Functions§
- detect_
os - “windows” | “macos” | “linux” | “” — the names the server uses.
- get_
hwid - This machine’s device id: 64 lowercase hex characters, stable across runs.
- verify_
offline_ license - Verify a signed offline
.licfile (a path, or the token itself) with zero network calls: signature, product, expiry, device and OS lock. Returns the signed payload. The expiry uses the local clock, which the user controls — keep offline files short-lived.