Skip to main content

Crate gpg_inspector_lib

Crate gpg_inspector_lib 

Source
Expand description

A library for parsing and inspecting OpenPGP (GPG) packets.

This crate provides tools for decoding ASCII-armored PGP data and parsing the binary packet structure according to RFC 4880 and RFC 9580.

§Quick Start

use gpg_inspector_lib::{parse, Packet, PacketBody};

let armored_key = r#"-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEZ... (your armored data)
-----END PGP PUBLIC KEY BLOCK-----"#;

// Parse returns an error for invalid/incomplete data
// For real usage, provide valid armored PGP data

§Modules

  • armor - ASCII armor decoding (Base64 + CRC24 checksum)
  • error - Error types for parsing failures
  • lookup - Algorithm and format lookup tables
  • packet - Packet parsing and type definitions
  • stream - Binary stream reader abstraction

Re-exports§

pub use armor::ArmorBlock;
pub use armor::ArmorResult;
pub use armor::MultiArmorResult;
pub use armor::decode_armor;
pub use armor::decode_armor_multi;
pub use armor::looks_binary;
pub use error::Error;
pub use error::Result;
pub use packet::Field;
pub use packet::Packet;
pub use packet::PacketBody;
pub use stream::ByteStream;

Modules§

armor
ASCII armor encoding and decoding for PGP data.
error
Error types for GPG packet parsing.
lookup
Algorithm and format lookup tables for OpenPGP identifiers.
packet
OpenPGP packet parsing and type definitions.
stream
Binary stream reader for parsing GPG packet data.

Functions§

parse
Parses ASCII-armored PGP data into a vector of packets.
parse_bytes
Parses raw binary PGP data into a vector of packets.