| Crates.io | wecanencrypt |
| lib.rs | wecanencrypt |
| version | 0.2.0 |
| created_at | 2025-12-31 17:07:45.010394+00 |
| updated_at | 2026-01-20 09:59:40.263843+00 |
| description | Simple Rust OpenPGP library for encryption, signing, and key management (includes rpgp). |
| homepage | |
| repository | https://github.com/kushaldas/wecanencrypt |
| max_upload_size | |
| id | 2015014 |
| size | 2,338,452 |
Simple Rust OpenPGP library for encryption, signing, and key management, built on top of rpgp.
use wecanencrypt::{create_key, encrypt_bytes, decrypt_bytes, CipherSuite, SubkeyFlags};
// Generate a new key
let key = create_key(
"passphrase",
&["Alice <alice@example.com>"],
CipherSuite::Cv25519,
None, None, None,
SubkeyFlags::default(),
false,
true,
)?;
// Encrypt data
let plaintext = b"Hello, World!";
let encrypted = encrypt_bytes(plaintext, &[&key.public_key.as_bytes()])?;
// Decrypt data
let decrypted = decrypt_bytes(&encrypted, &key.secret_key.as_bytes(), "passphrase")?;
cargo test --features card --test '*'
Or run specific test files:
# Individual test files
cargo test --features card --test integration_tests
cargo test --features card --test keystore_tests
cargo test --features card --test fixture_tests
Or combine them:
cargo test --features card --test integration_tests --test keystore_tests --test fixture_tests
Smart card tests require a physical YubiKey or compatible OpenPGP smart card. These tests are ignored by default:
cargo test --features card --test card_tests -- --ignored --test-threads=1
Note: Card tests automatically reset the card to factory defaults before each test.
keystore (default): SQLite-backed key storagenetwork (default): WKD and HKP key fetchingcard: Smart card support (requires hardware)draft-pqc: Post-quantum cryptography supportMIT