Skip to main content

Crate xml_sec

Crate xml_sec 

Source
Expand description

§xml-sec — Pure Rust XML Security

Drop-in replacement for libxmlsec1. XMLDSig, XMLEnc, C14N — no C dependencies.

§Features

  • C14N — XML Canonicalization (inclusive + exclusive)
  • XMLDSig — XML Digital Signatures (sign + verify)
  • XMLEnc — XML Encryption (encrypt + decrypt)
  • X.509 — Certificate-based key extraction

§Quick Start

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>"
);

Re-exports§

pub use error::XmlSecError;

Modules§

c14n
XML Canonicalization (C14N).
error
Error types for xml-sec.
xmldsig
XML Digital Signatures (XMLDSig).