Enum sequoia_openpgp::Packet [−][src]
#[non_exhaustive]
pub enum Packet {
Show 18 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),
}
Expand description
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)
This enum is marked as non-exhaustive
Unknown(Unknown)
Unknown packet.
Tuple Fields of Unknown
0: Unknown
Signature(Signature)
Signature packet.
Tuple Fields of Signature
0: Signature
OnePassSig(OnePassSig)
One pass signature packet.
Tuple Fields of OnePassSig
0: OnePassSig
PublicKey(Key<PublicParts, PrimaryRole>)
Public key packet.
Tuple Fields of PublicKey
0: Key<PublicParts, PrimaryRole>
PublicSubkey(Key<PublicParts, SubordinateRole>)
Public subkey packet.
Tuple Fields of PublicSubkey
SecretKey(Key<SecretParts, PrimaryRole>)
Public/Secret key pair.
Tuple Fields of SecretKey
0: Key<SecretParts, PrimaryRole>
SecretSubkey(Key<SecretParts, SubordinateRole>)
Public/Secret subkey pair.
Tuple Fields of SecretSubkey
Marker(Marker)
Marker packet.
Tuple Fields of Marker
0: Marker
Trust(Trust)
Trust packet.
Tuple Fields of Trust
0: Trust
UserID(UserID)
User ID packet.
Tuple Fields of UserID
0: UserID
UserAttribute(UserAttribute)
User attribute packet.
Tuple Fields of UserAttribute
Literal(Literal)
Literal data packet.
Tuple Fields of Literal
0: Literal
CompressedData(CompressedData)
Compressed literal data packet.
Tuple Fields of CompressedData
PKESK(PKESK)
Public key encrypted data packet.
Tuple Fields of PKESK
0: PKESK
SKESK(SKESK)
Symmetric key encrypted data packet.
Tuple Fields of SKESK
0: SKESK
SEIP(SEIP)
Symmetric key encrypted, integrity protected data packet.
Tuple Fields of SEIP
0: SEIP
MDC(MDC)
Modification detection code packet.
Tuple Fields of MDC
0: MDC
AED(AED)
AEAD Encrypted Data Packet.
Tuple Fields of AED
0: AED
Implementations
Returns the Packet's
corresponding OpenPGP tag.
Tags are explained in Section 4.3 of RFC 4880.
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
.
Hashes most everything into state.
This is an alternate implementation of Hash
, which does
not hash:
- The unhashed subpacket area of Signature packets.
- Secret key material.
Unlike Signature::normalize
, this method ignores
authenticated packets in the unhashed subpacket area.
Trait Implementations
Performs the conversion.
Convert the Key
struct to a Packet
.
Convert the Key
struct to a Packet
.
Convert the Key
struct to a Packet
.
Convert the Key
struct to a Packet
.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Creates a value from an iterator. Read more
Implement IntoIterator
so that
cert::insert_packets(sig)
just works.
Writes a serialized version of the specified Packet
to o
.
This function works recursively: if the packet contains any packets, they are also serialized.
Reads from the given reader.
Auto Trait Implementations
impl !RefUnwindSafe for Packet
impl !UnwindSafe for Packet
Blanket Implementations
Mutably borrows from an owned value. Read more