pub fn sign_document( events: &[XmlEvent], pub_key: &X509Ref, priv_key: &PKeyRef<Private>, ) -> Result<String, String>