Crate pgp

source ·
Expand description

🔐 pgp-lib

Rust library to deal with PGP operations, based on rPGP.

Features

  • Encrypts asynchronously bytes using multiple public keys
  • Decrypts asynchronously bytes using a secret key and its passphrase
  • Signs asynchronously bytes using a secret key and its passphrase
  • Verifies asynchronously bytes using a public key and a standalone signature
  • Finds public keys matching emails using WKD and Key Servers (HTTP and HKP protocols supported)
  • Provides helpers to generate a key pair, to read secret/public keys from path, to read signature from bytes etc.

Development

The development environment is managed by Nix. Running nix-shell will spawn a shell with everything you need to get started with the lib: cargo, cargo-watch, rust-bin, rust-analyzer

# Start a Nix shell
$ nix-shell

# then build the lib
$ cargo build -p pgp-lib

Contributing

If you find a bug that does not exist yet, please send an email at ~soywod/pimalaya@todo.sr.ht.

If you have a question, please send an email at ~soywod/pimalaya@lists.sr.ht.

If you want to propose a feature or fix a bug, please send a patch at ~soywod/pimalaya@lists.sr.ht using git send-email (see this guide on how to configure it).

If you want to subscribe to the mailing list, please send an email at ~soywod/pimalaya+subscribe@lists.sr.ht.

If you want to unsubscribe to the mailing list, please send an email at ~soywod/pimalaya+unsubscribe@lists.sr.ht.

If you want to discuss about the project, feel free to join the Matrix workspace #pimalaya or contact me directly @soywod.

Credits

nlnet

Special thanks to the nlnet foundation that helped Himalaya to receive financial support from the NGI Assure program of the European Commission in September, 2022.

Sponsoring

GitHub PayPal Ko-fi Buy Me a Coffee Liberapay

Modules

  • Module dedicated to PGP decryption.
  • Module dedicated to PGP encryption.
  • Module dedicated to HTTP Keyserver Protocol.
  • Module dedicated to HTTP.
  • rPGP
  • Module dedicated to PGP signing.
  • Module dedicated to PGP helpers.
  • Module dedicated to PGP verification.
  • Module dedicated to Web Key Directory.

Enums

Functions

  • Decrypts bytes using the given secret key and its passphrase.
  • Encrypts given bytes using the given list of public keys.
  • Generates a new pair of secret and public keys for the given email address and passphrase.
  • Reads a signed public key from the given path.
  • Reads a standalone signature from the given raw bytes.
  • Reads a signed secret key from the given path.
  • Reads a signed secret key from the given raw string.
  • Signs given bytes using the given private key and its passphrase.
  • Verifies given standalone signature using the given public key.

Type Aliases