#![forbid(unsafe_code)]
pub mod cli;
pub mod create;
pub mod dsse;
pub mod minisign;
pub mod model;
pub mod sigstore;
pub mod verify;
pub use model::{
Artifact, Identity, Predicate, ReleaseList, ReleaseListStatement, ReleaseRef, Scheme, Source,
Statement, Subject,
};
pub use sigstore::{Policy, Signer, Trust};
pub use verify::{Options, Verified, VerifiedList, verify, verify_release_list};
pub fn digest_file(path: &std::path::Path) -> std::io::Result<(String, u64)> {
use sha2::Digest as _;
let mut file = std::fs::File::open(path)?;
let mut hasher = sha2::Sha256::new();
let size = std::io::copy(&mut file, &mut hasher)?;
Ok((format!("{:x}", hasher.finalize()), size))
}