Expand description
§hymmalm — Rust wrapper for license-management-core
Safe Rust binding over the vendored native hymmalm core
(include/hymma/hlm_ffi.h). All licensing logic — JWS verification,
status rules, machine fingerprinting, the REST client flow, retry policy
and clock-tamper resistance — lives in the native core, so every language
wrapper behaves identically. This crate only marshals. The C sources are
compiled by build.rs and linked statically, so the crate is fully
self-contained (no shared library to ship) — ideal for Tauri apps.
Typical use:
use hymmalm::{LicenseClient, LicenseClientOptions, LicenseStatus};
let mut client = LicenseClient::new(LicenseClientOptions {
product_id: "PRD_01KWWPEPM0N070BDAHJ7G09RGV".into(),
client_api_key: "PUB_...".into(), // never a MST_ key
jwks_json: std::fs::read_to_string("signingkeys.json").unwrap(),
license_path: Some("/home/me/.myapp/license.lic".into()),
..Default::default()
})?;
let status = client.check()?; // trial bootstrap on first run
if status == LicenseStatus::InvalidTrial {
client.activate("RCPT-CODE-FROM-USER")?;
}Offline verification only (no network, e.g. checking a provisioned file):
let status = hymmalm::verify(&jws_string, &jwks_json, None, None, None)?;Modules§
- ffi
- Raw
extern "C"declarations for the flat FFI surface of license-management-core (include/hymma/hlm_ffi.h), hand-written — no bindgen.
Structs§
- License
Client - High-level licensing client (check / activate / deactivate / refresh).
- License
Client Options - Options for
LicenseClient::new.product_id,client_api_keyandjwks_jsonare required; everything else has a sensible default. - License
Error - Error reported by the native core.
- License
Import Result - What happened to an imported license file, with a message written for the end user.
Enums§
- License
Import Outcome - Outcome of
LicenseClient::import_license(nativehlm_import_result; the .NET SDK’s LicenseImportOutcome). - License
Status - Mirrors the native
hlm_status/ the .NET SDK’s LicenseStatusTitles. - Network
Failure - Why the license server could not be reached (native
hlm_net_failure; the .NET SDK’s NetworkFailureReason). - Signed
Format - Signed-license wire formats the server can emit.
Functions§
- machine_
id - This machine’s hardware fingerprint (52-char Crockford Base32) — identical to the .NET SDK’s DeviceId on the same machine.
- machine_
id_ v2 - Identity v2: the MachineGuid fingerprint on Windows (unique per Windows
install — the v1 sources collide across machines); identical to
machine_idon POSIX. - machine_
name - This computer’s name, as the SDK would send it.
- verify
- Offline one-shot: verify a signed license string against
jwks_jsonand report its status atnow(default: the system clock). Fails with code-3/-4when the string is malformed or tampered,-10/-11when the product/machine binding does not match.
Type Aliases§
- Result
- Result alias for this crate.