1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! # 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.
//!
//! ```no_run
//! 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
//! }
//! # Ok::<(), licers::Error>(())
//! ```
//!
//! The API is blocking (no async runtime needed). From async code, call it
//! inside `spawn_blocking`.
pub use ;
pub use ;
pub use ;
pub use verify_offline_license;
pub use FloatingSession;
// Re-exported so users can match on entitlement values without adding the crate.
pub use serde_json;