pacman_key/lib.rs
1//! Native Rust bindings for managing the pacman keyring on Arch Linux.
2//!
3//! This crate provides a structured API for interacting with `pacman-key`,
4//! parsing GPG output to return Rust types.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use pacman_key::Keyring;
10//!
11//! #[tokio::main]
12//! async fn main() -> pacman_key::Result<()> {
13//! let keyring = Keyring::new();
14//!
15//! let keys = keyring.list_keys().await?;
16//! for key in keys {
17//! println!("{}: {}", &key.fingerprint[..16], key.uid);
18//! }
19//!
20//! Ok(())
21//! }
22//! ```
23//!
24//! # Requirements
25//!
26//! - Arch Linux with `pacman-key` available
27//! - Root access for write operations (init, populate, sign, delete)
28//! - Read access to `/etc/pacman.d/gnupg` for list operations
29
30mod error;
31mod keyring;
32mod parse;
33mod types;
34mod validation;
35
36pub use error::{Error, Result};
37pub use keyring::{Keyring, ReadOnlyKeyring};
38pub use types::{Key, KeyType, KeyValidity, RefreshOptions, RefreshProgress, Signature};