licverify 0.1.1

Rust client for go-license verification system
Documentation
use licverify::Verifier;
use std::fs;

/// Integration test: Verify signature of license generated by licforge v2
///
/// This test reproduces the bug from issue #2 where double-hashing
/// caused signature verification to fail with licforge v2 licenses.
#[test]
fn test_verify_licforge_v2_license_signature() {
    // Load public key generated by licforge
    let public_key_pem = fs::read_to_string("tests/fixtures/keys/public.pem")
        .expect("Failed to read public key");

    // Create verifier
    let verifier = Verifier::new(&public_key_pem).expect("Failed to create verifier");

    // Load license generated by licforge v2
    let license = verifier
        .load_license("tests/fixtures/test_license.lic")
        .expect("Failed to load license");

    // Verify signature - this was failing before the fix due to double-hashing
    let result = verifier.verify_signature(&license);

    assert!(
        result.is_ok(),
        "Signature verification failed: {:?}. \
        This indicates the double-hashing bug from issue #2 is present.",
        result.err()
    );
}