This directory contains code related to Signed Web Bundles. Signed Web Bundles are an extension of normal, unsigned Web Bundles. Signed Web Bundles are encoded as a CBOR Sequence consisting of an Integrity Block followed by a Web Bundle.
In contrast to individually signed responses and Signed Exchanges, signatures of Signed Web Bundles provide a guarantee that the entire Web Bundle was not modified, including that no responses have been added or removed.
The format of the Integrity Block is described in this explainer. It contains magic bytes and version, similar to unsigned Web Bundles, as well as a signature stack. The signature stack contains one or more signatures and their corresponding public keys.
Note: Support for more than one signature is not yet fully designed and implemented (crbug.com/1366303).
Parsing Signed Web Bundles is a three step process:
WebBundleParser::ParseIntegrityBlock.SignedWebBundleSignatureVerifier.WebBundleParser::ParseMetadata while providing the length of the Integrity Block as the offset parameter.Due to the rule of 2, you may need to use data_decoder::SafeWebBundleParser instead of using WebBundleParser directly if your code runs in a non-sandboxed process.
Signed Web Bundles can be identified by a Web Bundle ID (see SignedWebBundleId), which is derived from the public key of its first signature. More information about the Web Bundle ID can be found in this explainer.