Expand description
XML Canonicalization (C14N).
Implements:
- Canonical XML 1.0 (inclusive)
- Canonical XML 1.1 (inclusive; xml:id propagation and xml:base fixup)
- Exclusive XML Canonicalization 1.0 (exclusive)
§Example
use xml_sec::c14n::{C14nAlgorithm, C14nMode, canonicalize_xml};
let xml = b"<root b=\"2\" a=\"1\"><empty/></root>";
let algo = C14nAlgorithm::new(C14nMode::Inclusive1_0, false);
let canonical = canonicalize_xml(xml, &algo)?;
assert_eq!(
String::from_utf8(canonical)?,
"<root a=\"1\" b=\"2\"><empty></empty></root>"
);Structs§
- C14n
Algorithm - Full C14N algorithm identifier.
Enums§
Functions§
- canonicalize
- Canonicalize an XML document or document subset.
- canonicalize_
xml - Convenience: parse XML bytes and canonicalize the whole document.