licensegate-rs

Crates.iolicensegate-rs
lib.rslicensegate-rs
version0.1.0
created_at2025-05-25 10:37:43.242032+00
updated_at2025-05-25 10:37:43.242032+00
descriptionUnofficial Rust SDK for integrating with the Licensegate licensing service
homepagehttps://github.com/rohitsangwan01/licensegate-rs
repositoryhttps://github.com/rohitsangwan01/licensegate-rs
max_upload_size
id1688264
size66,164
Rohit Sangwan (rohitsangwan01)

documentation

README

LicenseGate-Rust

Crates.io Version docs.rs page Crates.io Downloads Crates.io License

licensegate-rs is an unofficial Rust SDK for integrating with the LicenseGate licensing and activation service.

LicenseGate Logo

✨ Features

  • License key verification with LicenseGate
  • Challenge-response (RSA public key) validation
  • Custom license scopes
  • Configurable LicenseGate server URL
  • Async-friendly API using tokio

πŸ“¦ Installation

Add the crate to your Cargo.toml:

[dependencies]
licensegate-rs = "0.1.0"

πŸš€ Quick Start

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),
    }
}

βš™οΈ Advanced Usage

Custom LicenseGate Server URL

let licensegate = LicenseGate::new(user_id)
    .set_validation_server("https://your.custom.server");

Public RSA Key for Challenge Verification

let licensegate = LicenseGate::new(user_id)
    .set_public_rsa_key("PUBLIC_RSA_KEY");

License Key with Scoped Access

let config = LicenseGateConfig::new(license_key)
    .set_scope("pro");
let result = licensegate.verify(config).await;

πŸ“‚ Run Example

To test with the provided example:

cargo run --example sample

πŸ“š Documentation

Find full API docs on docs.rs

πŸ“ License

This project is licensed under the MIT License

Commit count: 2

cargo fmt