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
Provided methods
Reads from the given file.
The default implementation just uses from_reader(..)
, but
implementations can provide their own specialized version.
Implementors
impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]
impl<'a> Parse<'a, Key<UnspecifiedParts, UnspecifiedRole>> for Key<UnspecifiedParts, UnspecifiedRole>
[src]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.
Initializes a CertParser
from a Read
er.
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.
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.
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.
fn from_reader<R>(reader: R) -> Result<DecryptorBuilder<'a>> where
R: Read + 'a + Send + Sync,
[src]fn from_reader<R>(reader: R) -> Result<DetachedVerifierBuilder<'a>> where
R: Read + 'a + Send + Sync,
[src]fn from_bytes<D: ?Sized>(data: &'a D) -> Result<DetachedVerifierBuilder<'a>> where
D: AsRef<[u8]>,
[src]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
.