diff --git a/src/eme.rs b/src/eme.rs index cf33de7f..79d8c89b 100644 --- a/src/eme.rs +++ b/src/eme.rs @@ -25,6 +25,14 @@ pub fn parse_explicit_message_encryption(root: &Element) -> Result Element { + Element::builder("encryption") + .ns(ns::EME) + .attr("namespace", eme.namespace.clone()) + .attr("name", eme.name.clone()) + .build() +} + #[cfg(test)] mod tests { use minidom::Element; @@ -65,4 +73,12 @@ mod tests { }; assert_eq!(message, "Unknown child in encryption element."); } + + #[test] + fn test_serialise() { + let elem: Element = "".parse().unwrap(); + let eme = eme::ExplicitMessageEncryption { namespace: String::from("coucou"), name: None }; + let elem2 = eme::serialise(&eme); + assert_eq!(elem, elem2); + } }