signalscreen-checker 0.2.1

Windows code-signing hygiene checker. Reads the Authenticode signature in a PE file and grades it A-F. Pure Rust, no Windows dependency.
Documentation
use clap::Parser;
use signalscreen_checker::analyze;

#[derive(Parser)]
#[command(
    name = "signalscreen-check",
    about = "Windows code-signing hygiene checker"
)]
struct Args {
    /// Path to the PE file (.exe/.dll) to analyze
    file: String,
    /// Emit raw JSON instead of the human report
    #[arg(long)]
    json: bool,
}

fn main() -> anyhow::Result<()> {
    let args = Args::parse();
    let data = std::fs::read(&args.file)?;
    let now = std::time::SystemTime::now()
        .duration_since(std::time::UNIX_EPOCH)?
        .as_secs() as i64;
    let report = analyze(&args.file, &data, now)?;
    println!(
        "{}",
        if args.json {
            report.to_json()
        } else {
            report.to_human()
        }
    );
    Ok(())
}