| Crates.io | licensegate-rs |
| lib.rs | licensegate-rs |
| version | 0.1.0 |
| created_at | 2025-05-25 10:37:43.242032+00 |
| updated_at | 2025-05-25 10:37:43.242032+00 |
| description | Unofficial Rust SDK for integrating with the Licensegate licensing service |
| homepage | https://github.com/rohitsangwan01/licensegate-rs |
| repository | https://github.com/rohitsangwan01/licensegate-rs |
| max_upload_size | |
| id | 1688264 |
| size | 66,164 |
licensegate-rs is an unofficial Rust SDK for integrating with the LicenseGate licensing and activation service.
tokioAdd the crate to your Cargo.toml:
[dependencies]
licensegate-rs = "0.1.0"
Hereβs a minimal example for verifying a license key:
use licensegate::{LicenseGate, LicenseGateConfig, ValidationType};
#[tokio::main]
async fn main() {
let user_id = "ENTER_USER_ID";
let license_key = "ENTER_LICENSE_KEY";
let licensegate = LicenseGate::new(user_id);
match licensegate.verify(LicenseGateConfig::new(license_key)).await {
Ok(ValidationType::Valid) => println!("The key is valid."),
Ok(reason) => println!("The key is invalid. Reason: {:?}", reason),
Err(e) => eprintln!("Connection or server error: {:?}", e),
}
}
let licensegate = LicenseGate::new(user_id)
.set_validation_server("https://your.custom.server");
let licensegate = LicenseGate::new(user_id)
.set_public_rsa_key("PUBLIC_RSA_KEY");
let config = LicenseGateConfig::new(license_key)
.set_scope("pro");
let result = licensegate.verify(config).await;
To test with the provided example:
cargo run --example sample
Find full API docs on docs.rs
This project is licensed under the MIT License