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
//! Bundle integrity verification using cryptographic hashes.
//!
//! The integrity module provides SHA3-based hash verification to ensure bundles
//! haven't been tampered with during download or storage.
//!
//! ## Integrity Format
//!
//! Integrity hashes follow the [Subresource Integrity](https://w3c.github.io/webappsec-subresource-integrity/)
//! format:
//!
//! ```text
//! sha3-384-base64hash...
//! ```
//!
//! ## Example
//!
//! ```no_run
//! # #[cfg(feature = "integrity")]
//! # async {
//! use wvb::integrity::{Integrity, IntegrityChecker};
//! use wvb::{Bundle, BundleBuilder};
//!
//! // Create a bundle
//! let bundle = Bundle::builder()
//! .add_file("/index.html", b"<html></html>", None)
//! .build();
//!
//! // Generate integrity hash
//! let integrity = Integrity::from_bundle(&bundle).unwrap();
//! let hash_string = integrity.to_string();
//! println!("Integrity: {}", hash_string);
//!
//! // Verify integrity
//! let checker = IntegrityChecker::new(hash_string);
//! assert!(checker.verify(&bundle).is_ok());
//! # };
//! ```
//!
//! ## Integrity Policy
//!
//! Control when integrity verification is required:
//!
//! ```no_run
//! # #[cfg(all(feature = "integrity", feature = "remote"))]
//! # async {
//! use wvb::integrity::IntegrityPolicy;
//! use wvb::remote::{Remote, RemoteConfig};
//!
//! // Require integrity for all downloads
//! let config = RemoteConfig::default()
//! .integrity_policy(IntegrityPolicy::RequireForAll);
//!
//! let remote = Remote::new_with_config("https://updates.example.com", config);
//! # };
//! ```
pub use *;
pub use *;
pub use *;