1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! FCB — Forensic Case Bundle codec.
//!
//! One Rust crate, two compile targets: native (for the authoring CLI and the
//! teacher review platform) and WASM (for the in-browser student workbench).
//! It owns the FCB container format, passphrase-based crypto, compression, the
//! self-describing evidence model, the embedded task spec, and submission
//! packaging.
//!
//! This module wires the pieces together; the on-the-wire contract lives in
//! `openspec/specs/fcb-*`.
//!
//! # Example
//!
//! Pack an evidence case and open it back through the public API:
//!
//! ```
//! use ciborium::value::Value;
//! use fcb::case::{pack_case, CaseInput, CasePayload};
//! use fcb::container::BundleKind;
//! use fcb::evidence::{StreamData, StreamManifest};
//!
//! let manifest = vec![StreamManifest {
//! id: "s0".into(),
//! stream_type: "example.note.v1".into(),
//! records: 1,
//! }];
//! let payload = CasePayload {
//! streams: vec![StreamData {
//! id: "s0".into(),
//! records: vec![Value::Text("an event".into())],
//! }],
//! };
//! let input = CaseInput { case_id: "demo".into(), manifest, task: None, payload };
//!
//! // pack_case computes the canonical bundle_hash, builds the header meta,
//! // and seals with a fresh random salt/nonce. The literal "passphrase" here is
//! // illustration only — never hardcode a passphrase in real code.
//! let bytes = pack_case(&input, "passphrase")?;
//!
//! let (kind, header, _payload) = fcb::bundle::open_bytes(&bytes, "passphrase")?;
//! assert_eq!(kind, BundleKind::Case);
//! assert_eq!(header.case_id, "demo");
//! # Ok::<(), fcb::FcbError>(())
//! ```
//!
//! See [`docs/fcb-integration-guide.md`](https://github.com/triage-lab/fcb-rs/blob/main/docs/fcb-integration-guide.md)
//! for the full consumer guide.
pub use ;