release-hub 0.3.0

A simple updater for Rust GUI applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Signature verification helpers.

use crate::Result;
use minisign_verify::{PublicKey, Signature};

/// Verifies a downloaded payload against a Minisign public key and detached signature.
///
/// This is the low-level verification primitive used by the updater before any
/// installer bytes are handed to the platform-specific install path.
pub fn verify_minisign(payload: &[u8], pubkey: &str, signature: &str) -> Result<()> {
    let public_key = PublicKey::decode(pubkey)?;
    let signature = Signature::decode(signature)?;
    public_key.verify(payload, &signature, true)?;
    Ok(())
}