macro_rules! load_license {
($license_path:expr) => { ... };
($license_path:expr, $key_path:expr) => { ... };
}Expand description
Macro to load and validate a license at compile time.
This macro ensures that:
- The public key exists at compile time (include_str! fails otherwise)
- License validation happens early in the program
Returns Result<ValidatedLicense> - the caller decides how to handle errors.
§Usage
ⓘ
// In main.rs
let license = licenz_core::load_license!("license.lic")?;Or with a custom key path:
ⓘ
let license = licenz_core::load_license!("license.lic", "keys/public.pem")?;§Note
For policy enforcement (exit on failure, custom thresholds, etc.),
use licenz-policy crate’s PolicyEnforcer instead.