[−][src]Enum sequoia_openpgp::packet::Packet
Enumeration of packet types.
The different OpenPGP packets are detailed in [Section 5 of RFC 4880].
The Unknown
packet allows Sequoia to deal with packets that it
doesn't understand. It is basically a binary blob that includes
the packet's tag. See the module-level documentation for
details.
Note: This enum cannot be exhaustively matched to allow future extensions.
A note on equality
We define equality on Packet
as the equality of the serialized
form of their packet bodies as defined by RFC 4880. That is, two
packets are considered equal if and only if their serialized forms
are equal, modulo the OpenPGP framing (CTB
and length style,
potential partial body encoding).
Variants
Unknown(Unknown)
Unknown packet.
Signature(Signature)
Signature packet.
OnePassSig(OnePassSig)
One pass signature packet.
PublicKey(Key<PublicParts, PrimaryRole>)
Public key packet.
PublicSubkey(Key<PublicParts, SubordinateRole>)
Public subkey packet.
SecretKey(Key<SecretParts, PrimaryRole>)
Public/Secret key pair.
SecretSubkey(Key<SecretParts, SubordinateRole>)
Public/Secret subkey pair.
Marker(Marker)
Marker packet.
Trust(Trust)
Trust packet.
UserID(UserID)
User ID packet.
UserAttribute(UserAttribute)
User attribute packet.
Literal(Literal)
Literal data packet.
CompressedData(CompressedData)
Compressed literal data packet.
PKESK(PKESK)
Public key encrypted data packet.
SKESK(SKESK)
Symmetric key encrypted data packet.
SEIP(SEIP)
Symmetric key encrypted, integrity protected data packet.
MDC(MDC)
Modification detection code packet.
AED(AED)
AEAD Encrypted Data Packet.
Implementations
impl Packet
[src]
pub fn tag(&self) -> Tag
[src]
Returns the Packet's
corresponding OpenPGP tag.
Tags are explained in Section 4.3 of RFC 4880.
pub fn kind(&self) -> Option<Tag>
[src]
Returns the parsed Packet's
corresponding OpenPGP tag.
Returns the packets tag, but only if it was successfully
parsed into the corresponding packet type. If e.g. a
Signature Packet uses some unsupported methods, it is parsed
into an Packet::Unknown
. tag()
returns Tag::Signature
,
whereas kind()
returns None
.
Trait Implementations
impl Clone for Packet
[src]
impl Debug for Packet
[src]
impl<'a> Deref for Packet
[src]
impl<'a> DerefMut for Packet
[src]
impl Eq for Packet
[src]
impl<'_> From<&'_ Packet> for Tag
[src]
impl From<AED> for Packet
[src]
impl From<AED1> for Packet
[src]
impl From<CompressedData> for Packet
[src]
fn from(s: CompressedData) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Packet
[src]
fn from(k: Key<PublicParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<PublicParts, SubordinateRole>> for Packet
[src]
fn from(k: Key<PublicParts, SubordinateRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, PrimaryRole>> for Packet
[src]
fn from(k: Key<SecretParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, SubordinateRole>> for Packet
[src]
fn from(k: Key<SecretParts, SubordinateRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Literal> for Packet
[src]
impl From<MDC> for Packet
[src]
impl From<Marker> for Packet
[src]
impl From<OnePassSig> for Packet
[src]
fn from(s: OnePassSig) -> Self
[src]
impl From<OnePassSig3> for Packet
[src]
fn from(p: OnePassSig3) -> Self
[src]
impl From<PKESK> for Packet
[src]
impl From<PKESK3> for Packet
[src]
impl From<Packet> for Tag
[src]
impl From<Packet> for Result<Packet>
[src]
impl From<Packet> for Option<Token>
[src]
impl From<Packet> for PacketPile
[src]
impl From<SEIP> for Packet
[src]
impl From<SEIP1> for Packet
[src]
impl From<SKESK> for Packet
[src]
impl From<SKESK4> for Packet
[src]
impl From<SKESK5> for Packet
[src]
impl From<Signature> for Packet
[src]
impl From<Signature4> for Packet
[src]
fn from(s: Signature4) -> Self
[src]
impl From<Trust> for Packet
[src]
impl From<Unknown> for Packet
[src]
impl From<UserAttribute> for Packet
[src]
fn from(s: UserAttribute) -> Self
[src]
impl From<UserID> for Packet
[src]
impl FromIterator<Packet> for PacketPile
[src]
fn from_iter<I: IntoIterator<Item = Packet>>(iter: I) -> Self
[src]
impl Hash for Packet
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl IntoIterator for Packet
[src]
Implement IntoIterator
so that
cert::merge_packets(sig)
just works.
type Item = Packet
The type of the elements being iterated over.
type IntoIter = Once<Packet>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl Marshal for Packet
[src]
fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
Writes a serialized version of the specified Packet
to o
.
This function works recursively: if the packet contains any packets, they are also serialized.
fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
Exports a serialized version of the specified Packet
to o
.
This function works recursively: if the packet contains any packets, they are also serialized.
impl MarshalInto for Packet
[src]
fn serialized_len(&self) -> usize
[src]
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Parse<'a, Packet> for Packet
[src]
fn from_reader<R: 'a + Read>(reader: R) -> Result<Self>
[src]
fn from_file<P: AsRef<Path>>(path: P) -> Result<T>
[src]
fn from_bytes<D: AsRef<[u8]> + ?Sized>(data: &'a D) -> Result<T>
[src]
impl PartialEq<Packet> for Packet
[src]
impl Serialize for Packet
[src]
fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl SerializeInto for Packet
[src]
fn serialized_len(&self) -> usize
[src]
fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn to_vec(&self) -> Result<Vec<u8>>
[src]
fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl StructuralEq for Packet
[src]
impl StructuralPartialEq for Packet
[src]
impl TryFrom<Packet> for Cert
[src]
Auto Trait Implementations
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,