OpenPGP implemented in pure Rust, permissively licensed
rPGP is the only pure Rust implementation of OpenPGP, following the main RFCs
See IMPL_STATUS.md
for more details on the implemented PGP features.
It offers a flexible low-level API and gives users the ability to build higher level PGP tooling in the most compatible way possible. Additionally it fully supports all functionality required by the Autocrypt 1.1 e-mail encryption specification.
> cargo add pgp
use std::fs;
use pgp::{SignedSecretKey, Message, Deserializable};
let key_file = "key.sec.asc";
let msg_file = "msg.asc";
let key_string = fs::read_to_string("key.sec.asc").unwrap(),
let (secret_key, _headers) = SignedSecretKey::from_string(&key_string).unwrap();
let public_key = skey.public_key();
let msg_string = fs::read_to_string("msg.asc").unwrap();
let (msg, _headres) = Message::from_string(msg_string).unwrap();
// Verify this message
msg.verify(&pkey).unwrap();
let msg_content = msg.get_content().unwrap(); // actual message content
Last updated April 2024
- Implementation Status: IMPL_STATUS.md
- Security Staus: STATUS_SECURITY.md
- Supported Platforms: PLATFORMS.md
- Delta Chat: Messaging app that works over e-mail
rpgpie
: An experimental high level OpenPGP APIrsop
: A SOP CLI tool based on rPGP and rpgpie
Don't see your project here? Please send a PR :)
Checkout FAQ.md.
All crates in this repository support Rust 1.74 or higher. In future minimally supported version of Rust can be changed, but it will be done with a minor version bump.
Copyright 2024 N0, INC.
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.