๐ Offline License Validator
A simple, secure Rust library for offline license validation using Ed25519 signatures.
โจ Features
- โ Ed25519 Cryptography - Industry-standard digital signatures
- โ HWID Binding - Licenses tied to specific hardware
- โ Expiration Checking - Automatic validation
- โ
Persistent Storage - Saves to
~/.offline-license/ - โ Zero Dependencies on Runtime - Pure Rust, no network required
- โ Easy Integration - Just 3 lines of code
๐ฆ Installation
Add to your Cargo.toml:
[]
= "0.1.0"
๐ Quick Start
use ;
// 1. Initialize with your public key (from admin app)
let validator = new.expect;
// 2. Validate license
match validator.validate
๐ Usage Examples
Basic Validation
use LicenseValidator;
const PUBLIC_KEY: &str = "your_public_key_hex_here";
With Persistent Storage
use ;
Tauri Integration
use ;
const PUBLIC_KEY: &str = "913d5e19269699e51bcdb5c5a7106c278ef0e0fe92d31b76b6daf5bb00594fcf";
๐ Security
- Public key is hardcoded in your application (safe)
- Ed25519 signatures prevent tampering (64-byte signatures)
- HWID binding prevents license sharing across devices
- No network required for validation (fully offline)
- Expiration checks prevent use after expiry date
๐ Storage Location
Validated licenses are saved to:
| Platform | Path |
|---|---|
| Linux/macOS | ~/.offline-license/license.json |
| Windows | %USERPROFILE%\.offline-license\license.json |
๐ ๏ธ API Reference
LicenseValidator
// Create new validator
new // Validate license
validate
storage module
// Save validated license
save_license // Load saved license
load_saved_license // Delete saved license
delete_saved_license
Error Types
๐งช Testing
๐ License Format
Licenses use the format: Base64(JSON_Payload).Base64(Ed25519_Signature)
Example payload:
๐ค Integration Workflow
- Admin App generates Ed25519 keypair
- Admin App creates signed license for specific HWID
- Your App hardcodes public key
- Your App validates license using this library
- Library saves validated license to
~/.offline-license/
๐ License
MIT License - See LICENSE file for details
๐ Credits
Developed by Krakiun - Expert Software Development & Security Solutions
Built with:
ed25519-dalek- Ed25519 signaturesbase64- Base64 encodingchrono- Date/time handlingserde- Serialization
Need custom licensing solutions or security consulting? Visit krakiun.com