pub mod chain;
pub mod keys;
pub mod release;
pub use chain::{countersign, verify_chain, Envelope};
pub const FORMAT_VERSION: u32 = 1;
#[derive(Debug, PartialEq, Eq)]
pub enum SigError {
Json(String),
BadLength,
BadSignature,
UntrustedKey,
FormatIncompatible { found: u32 },
}
impl std::fmt::Display for SigError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{self:?}")
}
}
impl std::error::Error for SigError {}
pub fn digest(app_wasm: &[u8], manifest_mpack: &[u8], release_json: &[u8]) -> [u8; 32] {
let mut h = blake3::Hasher::new();
h.update(app_wasm);
h.update(manifest_mpack);
h.update(release_json);
*h.finalize().as_bytes()
}