[−][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 (Non-exhaustive)
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]
type Target = Common
The resulting type after dereferencing.
pub fn deref(&self) -> &Self::Target
[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]
pub fn from(s: CompressedData) -> Self
[src]
impl From<Key<PublicParts, PrimaryRole>> for Packet
[src]
pub fn from(k: Key<PublicParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<PublicParts, SubordinateRole>> for Packet
[src]
pub fn from(k: Key<PublicParts, SubordinateRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, PrimaryRole>> for Packet
[src]
pub fn from(k: Key<SecretParts, PrimaryRole>) -> Self
[src]
Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, SubordinateRole>> for Packet
[src]
pub 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]
pub fn from(s: OnePassSig) -> Self
[src]
impl From<OnePassSig3> for Packet
[src]
pub 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]
pub fn from(s: Signature4) -> Self
[src]
impl From<Trust> for Packet
[src]
impl From<Unknown> for Packet
[src]
impl From<UserAttribute> for Packet
[src]
pub fn from(s: UserAttribute) -> Self
[src]
impl From<UserID> for Packet
[src]
impl FromIterator<Packet> for PacketPile
[src]
pub fn from_iter<I: IntoIterator<Item = Packet>>(iter: I) -> Self
[src]
impl Hash for Packet
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub 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::insert_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?
pub fn into_iter(self) -> Self::IntoIter
[src]
impl Marshal for Packet
[src]
pub 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.
pub 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]
pub fn serialized_len(&self) -> usize
[src]
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn to_vec(&self) -> Result<Vec<u8>>
[src]
pub fn export_to_vec(&self) -> Result<Vec<u8>>
[src]
impl<'a> Parse<'a, Packet> for Packet
[src]
pub fn from_reader<R: 'a + Read + Send + Sync>(reader: R) -> Result<Self>
[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<T>
[src]
pub fn from_bytes<D: AsRef<[u8]> + ?Sized + Send + Sync>(
data: &'a D
) -> Result<T>
[src]
data: &'a D
) -> Result<T>
impl PartialEq<Packet> for Packet
[src]
impl Serialize for Packet
[src]
pub fn serialize(&self, o: &mut dyn Write) -> Result<()>
[src]
pub fn export(&self, o: &mut dyn Write) -> Result<()>
[src]
impl SerializeInto for Packet
[src]
pub fn serialized_len(&self) -> usize
[src]
pub fn serialize_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub fn to_vec(&self) -> Result<Vec<u8>>
[src]
pub fn export_into(&self, buf: &mut [u8]) -> Result<usize>
[src]
pub 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
[src]
impl Send for Packet
[src]
impl Sync for Packet
[src]
impl Unpin for Packet
[src]
impl UnwindSafe for Packet
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,