Skip to main content

archergate_license/
lib.rs

1//! # archergate-license
2//!
3//! License management SDK for indie software developers.
4//!
5//! Machine binding, offline grace periods, and 14-day trials — in a single crate.
6//!
7//! ## Quick start (Rust)
8//!
9//! ```no_run
10//! use archergate_license::LicenseClient;
11//!
12//! let client = LicenseClient::new("your-api-key", "com.you.your-plugin");
13//!
14//! match client.validate("XXXX-XXXX-XXXX-XXXX") {
15//!     Ok(()) => { /* app runs normally */ }
16//!     Err(e) => eprintln!("License check failed: {e}"),
17//! }
18//! ```
19//!
20//! ## Quick start (C / C++ / JUCE)
21//!
22//! Link against `archergate_license.lib` (Windows) or `libarchergate_license.a` (macOS/Linux)
23//! and include `archergate_license.h`:
24//!
25//! ```c
26//! #include "archergate_license.h"
27//!
28//! AgLicenseClient* client = ag_license_new("your-api-key", "com.you.synth");
29//! int rc = ag_license_validate(client, "XXXX-XXXX-XXXX-XXXX");
30//! if (rc != 0) {
31//!     const char* msg = ag_license_error_string(rc);
32//!     // handle error
33//! }
34//! ag_license_free(client);
35//! ```
36
37#![deny(missing_docs)]
38
39mod cache;
40mod client;
41mod error;
42pub mod ffi;
43mod fingerprint;
44/// Anti-tamper integrity checks for cracking resistance.
45pub mod integrity;
46mod types;
47
48pub use client::LicenseClient;
49pub use error::LicenseError;
50pub use integrity::ValidationReceipt;
51pub use types::TrialLicense;
52
53/// Re-exported API wire types for custom integrations.
54pub mod api_types {
55    pub use crate::types::{
56        ActivateRequest, ActivateResponse, CachedLicense, CachedTrial, ValidateRequest,
57        ValidateResponse,
58    };
59}