Enum sequoia_openpgp::Packet [−][src]
#[non_exhaustive] pub enum Packet {}Show variants
Unknown(Unknown), Signature(Signature), OnePassSig(OnePassSig), PublicKey(Key<PublicParts, PrimaryRole>), PublicSubkey(Key<PublicParts, SubordinateRole>), SecretKey(Key<SecretParts, PrimaryRole>), SecretSubkey(Key<SecretParts, SubordinateRole>), Marker(Marker), Trust(Trust), UserID(UserID), UserAttribute(UserAttribute), Literal(Literal), CompressedData(CompressedData), PKESK(PKESK), SKESK(SKESK), SEIP(SEIP), MDC(MDC), AED(AED),
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]
impl Packet
[src]pub fn tag(&self) -> Tag
[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]
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 From<CompressedData> for Packet
[src]
impl From<CompressedData> for Packet
[src]fn from(s: CompressedData) -> Self
[src]
fn from(s: CompressedData) -> Self
[src]Performs the conversion.
impl From<Key<PublicParts, PrimaryRole>> for Packet
[src]
impl From<Key<PublicParts, PrimaryRole>> for Packet
[src]fn from(k: Key<PublicParts, PrimaryRole>) -> Self
[src]
fn from(k: Key<PublicParts, PrimaryRole>) -> Self
[src]Convert the Key
struct to a Packet
.
impl From<Key<PublicParts, SubordinateRole>> for Packet
[src]
impl From<Key<PublicParts, SubordinateRole>> for Packet
[src]fn from(k: Key<PublicParts, SubordinateRole>) -> Self
[src]
fn from(k: Key<PublicParts, SubordinateRole>) -> Self
[src]Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, PrimaryRole>> for Packet
[src]
impl From<Key<SecretParts, PrimaryRole>> for Packet
[src]fn from(k: Key<SecretParts, PrimaryRole>) -> Self
[src]
fn from(k: Key<SecretParts, PrimaryRole>) -> Self
[src]Convert the Key
struct to a Packet
.
impl From<Key<SecretParts, SubordinateRole>> for Packet
[src]
impl From<Key<SecretParts, SubordinateRole>> for Packet
[src]fn from(k: Key<SecretParts, SubordinateRole>) -> Self
[src]
fn from(k: Key<SecretParts, SubordinateRole>) -> Self
[src]Convert the Key
struct to a Packet
.
impl From<OnePassSig> for Packet
[src]
impl From<OnePassSig> for Packet
[src]fn from(s: OnePassSig) -> Self
[src]
fn from(s: OnePassSig) -> Self
[src]Performs the conversion.
impl From<OnePassSig3> for Packet
[src]
impl From<OnePassSig3> for Packet
[src]fn from(p: OnePassSig3) -> Self
[src]
fn from(p: OnePassSig3) -> Self
[src]Performs the conversion.
impl From<Signature4> for Packet
[src]
impl From<Signature4> for Packet
[src]fn from(s: Signature4) -> Self
[src]
fn from(s: Signature4) -> Self
[src]Performs the conversion.
impl From<UserAttribute> for Packet
[src]
impl From<UserAttribute> for Packet
[src]fn from(s: UserAttribute) -> Self
[src]
fn from(s: UserAttribute) -> Self
[src]Performs the conversion.
impl FromIterator<Packet> for PacketPile
[src]
impl FromIterator<Packet> for PacketPile
[src]fn from_iter<I: IntoIterator<Item = Packet>>(iter: I) -> Self
[src]
fn from_iter<I: IntoIterator<Item = Packet>>(iter: I) -> Self
[src]Creates a value from an iterator. Read more
impl IntoIterator for Packet
[src]
impl IntoIterator for Packet
[src]Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
impl Marshal for Packet
[src]
impl Marshal for Packet
[src]impl MarshalInto for Packet
[src]
impl MarshalInto for Packet
[src]impl<'a> Parse<'a, Packet> for Packet
[src]
impl<'a> Parse<'a, Packet> for Packet
[src]impl SerializeInto for Packet
[src]
impl SerializeInto for Packet
[src]impl Eq for Packet
[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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more