pacman-key
Native Rust interface for managing the pacman keyring on Arch Linux.
Installation
[]
= "0.4"
Usage
use Keyring;
async
Operations
Read-only (also available on Keyring::with_homedir for a custom GPG home):
list_keys,list_signatures,check_signatures(verified,--check-sigs)export_keys(armored),fingerprintsverify_signature(detached/embedded, returnsVerifyResult)get_ownertrust,is_initialized
Mutating (target the system keyring, require root):
init_keyring,populateadd_keys(import from file),receive_keys,refresh_keyslocally_sign_key,delete_key,set_ownertrustimport_keyrings,import_trustdb,update_trustdb
Long-running operations take an OperationOptions for timeout and
cancellation. The timeout covers the whole operation, including the key
listing that refresh_keys runs first. Set a custom keyserver with
Keyring::new().with_keyserver(url).
Each operation runs its subprocesses in a new process group, which is killed with SIGKILL on timeout, on cancellation, when the operation's future is dropped, or when the calling process terminates. Terminal signals such as Ctrl-C do not reach that group directly. A killed gpg can leave stale lock files in the keyring directory; they do not block later runs.
Mutating operations do not rebuild the trust database automatically (unlike the
pacman-key CLI). Call update_trustdb after add_keys, delete_key,
locally_sign_key, receive_keys, or set_ownertrust when computed validity
must be current.
License
GPL-3.0