Skip to main content

Module c14n

Module c14n 

Source
Expand description

XML Canonicalization (C14N).

Implements:

§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§

C14nAlgorithm
Full C14N algorithm identifier.

Enums§

C14nError
Error type for C14N operations.
C14nMode
C14N algorithm mode (without the comments flag).

Functions§

canonicalize
Canonicalize an XML document or document subset.
canonicalize_xml
Convenience: parse XML bytes and canonicalize the whole document.