pub struct Signature {
    pub style: SignatureStyle,
    pub offset: u64,
    pub size: u64,
    pub key_info: KeyInfo,
}

Fields§

§style: SignatureStyle§offset: u64§size: u64§key_info: KeyInfo

Implementations§

Obtained parsed X.509 certificates.

Examples found in repository?
src/reader.rs (line 334)
329
330
331
332
333
334
335
336
337
338
339
340
    pub fn rsa_signature(&mut self) -> XarResult<Option<(Vec<u8>, Vec<CapturedX509Certificate>)>> {
        if let Some(sig) = self.toc.find_signature(SignatureStyle::Rsa).cloned() {
            let mut data = Vec::<u8>::with_capacity(sig.size as _);
            self.write_heap_slice(sig.offset, sig.size as _, &mut data)?;

            let certs = sig.x509_certificates()?;

            Ok(Some((data, certs)))
        } else {
            Ok(None)
        }
    }
Examples found in repository?
src/table_of_contents.rs (line 98)
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    pub fn write_xml<W: Write>(&self, writer: &mut EventWriter<W>) -> XarResult<()> {
        writer.write(XmlEvent::StartDocument {
            version: XmlVersion::Version10,
            encoding: Some("UTF-8"),
            standalone: None,
        })?;

        writer.write(XmlEvent::start_element("xar"))?;
        writer.write(XmlEvent::start_element("toc"))?;

        writer.write(XmlEvent::start_element("creation-time"))?;
        writer.write(XmlEvent::characters(&self.creation_time))?;
        writer.write(XmlEvent::end_element())?;

        self.checksum.write_xml(writer)?;

        if let Some(sig) = &self.signature {
            sig.write_xml(writer, "signature")?;
        }
        if let Some(sig) = &self.x_signature {
            sig.write_xml(writer, "x-signature")?;
        }

        for file in &self.files {
            file.write_xml(writer)?;
        }

        writer.write(XmlEvent::end_element().name("toc"))?;
        writer.write(XmlEvent::end_element().name("xar"))?;

        Ok(())
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more