Crate licverify

Crate licverify 

Source
Expand description

§licverify

Enterprise-grade license verification for Rust applications.

licverify is a Rust client for the go-license verification system, providing secure license validation with RSA-SHA256 signatures, hardware binding, and automatic expiry enforcement.

This library is fully compatible with licenses generated by the go-license ecosystem, including the main go-license generator and python-licverify client.

§Features

  • 🔐 RSA-SHA256 Verification: Cryptographic signature validation using 2048-bit RSA
  • 💻 Hardware Binding: Device-locked licensing with MAC addresses, disk IDs, and hostnames
  • ⏰ Expiry Validation: Automatic license expiration checking
  • 🔄 Format Support: Compatible with both binary (v2.0+) and JSON (v1.x) license formats
  • 🚀 Cross-Platform: Supports Linux, Windows, and macOS
  • 📚 Easy Integration: Simple API for embedding in applications

§Quick Start

use licverify::Verifier;

// Load your RSA public key
let public_key_pem = std::fs::read_to_string("public.pem")?;
let verifier = Verifier::new(&public_key_pem)?;

// Load and verify license
let license = verifier.load_license("license.lic")?;
verifier.verify(&license)?;

println!("✅ License is valid!");
println!("Customer: {}", license.customer_id);
println!("Expires: {}", license.expiry_date);

§Hardware Binding

Prevent license sharing by binding to specific hardware:

use licverify::{Verifier, HardwareInfo};

// Verify hardware binding
verifier.verify_hardware_binding(&license)?;

// Get current hardware info
let hw_info = HardwareInfo::get()?;
println!("MAC Addresses: {:?}", hw_info.mac_addresses);

§License Formats

  • Binary Format: Full support for go-license v2.0+ binary format
  • JSON Format: Legacy compatibility with go-license v1.x JSON format
  • Signature: RSA-2048 PKCS#1 v1.5 with SHA-256 hashing

Re-exports§

pub use error::LicenseError;
pub use error::LicenseResult;
pub use hardware::HardwareBinding;
pub use hardware::HardwareInfo;
pub use license::License;
pub use verifier::Verifier;

Modules§

error
hardware
license
verifier