pub fn xml_add_certificate<W: Write>(
    key_use: &str,
    base64_encoded_certificate: &str,
    writer: &mut EventWriter<W>,
) {
    write_event(
        XmlEvent::start_element(("md", "KeyDescriptor"))
            .attr("use", key_use)
            .into(),
        writer,
    );
    write_event(
        XmlEvent::start_element(("ds", "KeyInfo"))
            .attr("xmlns:ds", "http://www.w3.org/2000/09/xmldsig#")
            .into(),
        writer,
    );
    write_event(XmlEvent::start_element(("ds", "X509Data")).into(), writer);
    write_event(
        XmlEvent::start_element(("ds", "X509Certificate")).into(),
        writer,
    );

    write_event(
        XmlEvent::characters(&base64_encoded_certificate.replace("\n", "")),
        writer,
    );
    // end the x509certificate
    write_event(XmlEvent::end_element().into(), writer);
    // end the x509data
    write_event(XmlEvent::end_element().into(), writer);
    // end the ds:keyinfo
    write_event(XmlEvent::end_element().into(), writer);
    // end the md:keydescriptor signing
    write_event(XmlEvent::end_element().into(), writer);
}
/// Write a signing key to an XMLEventWriter
Write a signing key to an XMLEventWriter
Write a signing key to an XMLEventWriter
pub fn xml_add_certificate<W: Write>(
    key_use: &str,
    base64_encoded_certificate: &str,
    writer: &mut EventWriter<W>,
) {
    write_event(
        XmlEvent::start_element(("md", "KeyDescriptor"))
            .attr("use", key_use)
            .into(),
        writer,
    );
    write_event(
        XmlEvent::start_element(("ds", "KeyInfo"))
            .attr("xmlns:ds", "http://www.w3.org/2000/09/xmldsig#")
            .into(),
        writer,
    );
    write_event(XmlEvent::start_element(("ds", "X509Data")).into(), writer);
    write_event(
        XmlEvent::start_element(("ds", "X509Certificate")).into(),
        writer,
    );
    write_event(
        XmlEvent::characters(&base64_encoded_certificate.replace("\n", "")),
        writer,
    );
    // end the x509certificate
    write_event(XmlEvent::end_element().into(), writer);
    // end the x509data
    write_event(XmlEvent::end_element().into(), writer);
    // end the ds:keyinfo
    write_event(XmlEvent::end_element().into(), writer);
    // end the md:keydescriptor signing
    write_event(XmlEvent::end_element().into(), writer);
}
pub fn xml_add_certificate < W : Write > ( key_use : & str , base64_encoded_certificate : & str , writer : & mut EventWriter < W > , ) { write_event ( XmlEvent :: start_element ( ( " " , " " ) ) . attr ( " " , key_use ) . into ( ) , writer , ) ; write_event ( XmlEvent :: start_element ( ( " " , " " ) ) . attr ( " " , " " ) . into ( ) , writer , ) ; write_event ( XmlEvent :: start_element ( ( " " , " " ) ) . into ( ) , writer ) ; write_event ( XmlEvent :: start_element ( ( " " , " " ) ) . into ( ) , writer , ) ; write_event ( XmlEvent :: characters ( & base64_encoded_certificate . replace ( " \n " , " " ) ) , writer , ) ; // end the x509certificate write_event ( XmlEvent :: end_element ( ) . into ( ) , writer ) ; // end the x509data write_event ( XmlEvent :: end_element ( ) . into ( ) , writer ) ; // end the ds:keyinfo write_event ( XmlEvent :: end_element ( ) . into ( ) , writer ) ; // end the md:keydescriptor signing write_event ( XmlEvent :: end_element ( ) . into ( ) , writer ) ; }
Write a signing key to an XMLEventWriter
Write a signing key to an XMLEventWriter
key_use
&str
base64_encoded_certificate
&str
writer
&mut EventWriter<W>
key_use
&str
base64_encoded_certificate
&str
writer
&mut EventWriter<W>