[−][src]Enum sequoia_openpgp::packet::prelude::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. The Unknown
packet is basically a binary
blob that includes the packet's tag.
The unknown packet is also used for packets that are understood,
but use unsupported options. For instance, when the packet parser
encounters a compressed data packet with an unknown compression
algorithm, it returns the packet in an Unknown
packet rather
than a CompressedData
packet.
Note: This enum cannot be exhaustively matched to allow future extensions.
A note on equality
We define equality on Packet
like equality of the serialized
form of the packet bodies defined by RFC4880, i.e. two packets are
considered equal if and only if their serialized form is 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 Arbitrary for Packet
[src]
fn arbitrary<G: Gen>(g: &mut G) -> Self
[src]
fn shrink(&self) -> Box<dyn Iterator<Item = Self> + 'static>
[src]
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<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 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 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 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]
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,