wecanencrypt
Simple Rust OpenPGP library for encryption, signing, and key management, built on top of rpgp.
Features
- Key Generation: Create OpenPGP keys with various cipher suites (Cv25519, RSA2k, RSA4k, NIST P-256/P-384/P-521)
- Encryption/Decryption: Encrypt and decrypt files and byte streams
- Signing/Verification: Sign messages (inline, cleartext, detached) and verify signatures
- Key Parsing: Parse certificates from files or bytes, extract key information
- Keyring Support: Parse and export GPG keyrings
- SSH Key Export: Convert OpenPGP authentication keys to SSH public key format
- Network Operations: Fetch keys via WKD (Web Key Directory) and HKP keyservers
- KeyStore: SQLite-backed key storage with search and management capabilities
Usage
use ;
// Generate a new key
let key = create_key?;
// Encrypt data
let plaintext = b"Hello, World!";
let encrypted = encrypt_bytes?;
// Decrypt data
let decrypted = decrypt_bytes?;
Optional Features
keystore(default): SQLite-backed key storagenetwork(default): WKD and HKP key fetching
License
MIT