1pub mod chain;
4pub mod keys;
5pub mod release;
6
7pub use chain::{countersign, verify_chain, Envelope};
8
9pub const FORMAT_VERSION: u32 = 1;
11
12#[derive(Debug, PartialEq, Eq)]
13pub enum SigError {
14 Json(String),
15 BadLength,
16 BadSignature,
17 UntrustedKey,
18 FormatIncompatible { found: u32 },
19}
20impl std::fmt::Display for SigError {
21 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22 write!(f, "{self:?}")
23 }
24}
25impl std::error::Error for SigError {}
26
27pub fn digest(app_wasm: &[u8], manifest_mpack: &[u8], release_json: &[u8]) -> [u8; 32] {
29 let mut h = blake3::Hasher::new();
30 h.update(app_wasm);
31 h.update(manifest_mpack);
32 h.update(release_json);
33 *h.finalize().as_bytes()
34}