Trait sequoia_openpgp::parse::Parse[][src]

pub trait Parse<'a, T> {
    fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<T>;

    fn from_file<P: AsRef<Path>>(path: P) -> Result<T> { ... }
fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(
        data: &'a D
    ) -> Result<T> { ... } }
Expand description

Parsing of packets and related structures.

This is a uniform interface to parse packets, messages, keys, and related data structures.

Required methods

Reads from the given reader.

Provided methods

Reads from the given file.

The default implementation just uses from_reader(..), but implementations can provide their own specialized version.

Reads from the given slice.

The default implementation just uses from_reader(..), but implementations can provide their own specialized version.

Implementors

Reads an S2K from reader.

Starts parsing an OpenPGP message stored in a std::io::Read object.

This function returns a PacketParser for the first packet in the stream.

Starts parsing an OpenPGP message stored in a file named path.

This function returns a PacketParser for the first packet in the stream.

Starts parsing an OpenPGP message stored in a buffer.

This function returns a PacketParser for the first packet in the stream.

Initializes a CertParser from a Reader.

Initializes a CertParser from a File.

Initializes a CertParser from a byte string.

Parses an OpenPGP packet’s header as described in Section 4.2 of RFC 4880.

Returns the first Cert encountered in the reader.

Returns the first Cert encountered in the file.

Returns the first Cert found in buf.

buf must be an OpenPGP-encoded message.

Reads a Message from the specified reader.

See Message::try_from for more details.

Reads a Message from the specified file.

See Message::try_from for more details.

Reads a Message from buf.

See Message::try_from for more details.

Deserializes the OpenPGP message stored in a std::io::Read object.

Although this method is easier to use to parse a sequence of OpenPGP packets than a PacketParser or a PacketPileParser, this interface buffers the whole message in memory. Thus, the caller must be certain that the deserialized message is not too large.

Note: this interface does buffer the contents of packets.

Deserializes the OpenPGP message stored in the file named by path.

See from_reader for more details and caveats.

Deserializes the OpenPGP message stored in the provided buffer.

See from_reader for more details and caveats.

Creates a PacketParserBuilder for an OpenPGP message stored in a std::io::Read object.

Creates a PacketParserBuilder for an OpenPGP message stored in the file named path.

Creates a PacketParserBuilder for an OpenPGP message stored in the specified buffer.

Creates a PacketPileParser to parse the OpenPGP message stored in the io::Read object.

Creates a PacketPileParser to parse the OpenPGP message stored in the file named by path.

Creates a PacketPileParser to parse the OpenPGP message stored in the provided buffer.