Expand description

Brings the most relevant types and traits into scope for working with packets.

Less often used types and traits that are more likely to lead to a naming conflict are not brought into scope. For instance, the markers PublicParts, etc. are not imported to avoid potential naming conflicts. Instead, they should be accessed as key::PublicParts. And, user_attribute::Subpacket is not imported, because it is rarely used. If required, it should be imported explicitly.


use openpgp::packet::prelude::*;


pub use crate::packet::AED;
pub use crate::packet::Header;
pub use crate::packet::Key;
pub use crate::packet::OnePassSig;
pub use crate::packet::PKESK;
pub use crate::packet::Packet;
pub use crate::packet::SEIP;
pub use crate::packet::SKESK;
pub use crate::packet::Signature;
pub use crate::packet::UserAttribute;
pub use crate::packet::aed::AED1;
pub use crate::packet::key;
pub use crate::packet::key::Key4;
pub use crate::packet::key::SecretKeyMaterial;
pub use crate::packet::one_pass_sig::OnePassSig3;
pub use crate::packet::pkesk::PKESK3;
pub use crate::packet::seip::SEIP1;
pub use crate::packet::signature;
pub use crate::packet::signature::Signature4;
pub use crate::packet::signature::SignatureBuilder;
pub use crate::packet::skesk::SKESK4;
pub use crate::packet::skesk::SKESK5;
pub use crate::packet::user_attribute;


Holds a compressed data packet.

Holds packet bodies.

Holds a literal packet.

Holds an MDC packet.

Holds a Marker packet.

Holds a Trust packet.

Holds an unknown packet.

Holds a UserID packet.


A packet’s body holds either unprocessed bytes, processed bytes, or packets.

The OpenPGP packet tags as defined in Section 4.3 of RFC 4880.


Convenient downcasting from Packets to Packet Bodies.