Crate pgp

source
Expand description

§🔐 pgp-lib

Cross-platform, asynchronous Rust library to deal with PGP operations, based on rPGP.

  • Basic PGP operations: encrypt, decrypt, sign, verify
  • PGP helpers: generate a key pair, read secret/public keys from path, read signature from bytes etc
  • HTTP public key discovery via WKD and HKP (requires key-discovery feature)
  • Tokio async runtime (async-std planned)
  • Rustls rust crypto (native-tls planned)

See the full API documentation on docs.rs.

§Sponsoring

nlnet

Special thanks to the NLnet foundation and the European Commission that helped the project to receive financial support from various programs:

If you appreciate the project, feel free to donate using one of the following providers:

GitHub Ko-fi Buy Me a Coffee Liberapay thanks.dev PayPal

Re-exports§

Modules§

  • Module dedicated to PGP decryption.
  • Module dedicated to PGP encryption.
  • httpkey-discovery
    Module dedicated to HTTP.
  • Module dedicated to PGP signing.
  • Module dedicated to PGP helpers.
  • Module dedicated to PGP verification.

Enums§

  • The global Error enum of the library.

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§

  • The global Result alias of the library.