hashes: Implement serialise.

This commit is contained in:
Emmanuel Gil Peyrot 2017-04-23 18:36:12 +01:00
parent 78e8a06ec2
commit 20949c2832

View file

@ -28,6 +28,14 @@ pub fn parse_hash(root: &Element) -> Result<Hash, Error> {
}) })
} }
pub fn serialise(hash: &Hash) -> Element {
Element::builder("hash")
.ns(ns::HASHES)
.attr("algo", hash.algo.clone())
.append(hash.hash.clone())
.build()
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use minidom::Element; use minidom::Element;