#[non_exhaustive]pub enum Tag {
}
Expand description
The OpenPGP packet tags as defined in Section 5 of RFC 9580.
The values correspond to the serialized format.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Reserved
Reserved Packet tag.
PKESK
Public-Key Encrypted Session Key Packet.
Signature
Signature Packet.
SKESK
Symmetric-Key Encrypted Session Key Packet.
OnePassSig
One-Pass Signature Packet.
SecretKey
Secret-Key Packet.
PublicKey
Public-Key Packet.
SecretSubkey
Secret-Subkey Packet.
CompressedData
Compressed Data Packet.
SED
Symmetrically Encrypted Data Packet.
Marker
Marker Packet (Obsolete Literal Packet).
Literal
Literal Data Packet.
Trust
Trust Packet.
UserID
User ID Packet.
PublicSubkey
Public-Subkey Packet.
UserAttribute
User Attribute Packet.
SEIP
Sym. Encrypted and Integrity Protected Data Packet.
MDC
Modification Detection Code Packet.
AED
Reserved (“AEAD Encrypted Data Packet”).
Padding
Padding packet.
Unknown(u8)
Unassigned packets (as of RFC4880).
Private(u8)
Experimental packets.
Implementations§
Source§impl Tag
impl Tag
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Returns whether the Tag
denotes a critical packet.
Upon encountering an unknown critical packet, implementations MUST reject the whole packet sequence. On the other hand, unknown non-critical packets MUST be ignored. See Section 4.3 of RFC 9580.
Sourcepub fn valid_start_of_message(&self) -> bool
pub fn valid_start_of_message(&self) -> bool
Returns whether the Tag
can be at the start of a valid
message.
Certs can start with PublicKey
, TSKs with a SecretKey
.
Messages start with a OnePassSig
, Signature
(old style
non-one pass signatures), PKESK
, SKESK
, CompressedData
,
or Literal
.
Signatures can stand alone either as a detached signature, a third-party certification, or a revocation certificate.
Sourcepub fn variants() -> impl Iterator<Item = Tag>
pub fn variants() -> impl Iterator<Item = Tag>
Returns an iterator over all valid variants.
Returns an iterator over all known variants. This does not
include the Tag::Reserved
, Tag::Private
, or
Tag::Unknown
variants.