pubky_messenger/lib.rs
1//! # Pubky Messenger
2//!
3//! A Rust library for secure private messaging using the Pubky protocol.
4//!
5//! ## Features
6//!
7//! - End-to-end encrypted messaging
8//! - Authentication via pkarr recovery files
9//! - Message signature verification
10//! - Profile and contact management
11//!
12//! ## Example
13//!
14//! ```no_run
15//! use pubky_messenger::PrivateMessengerClient;
16//! use pkarr::PublicKey;
17//!
18//! # async fn example() -> anyhow::Result<()> {
19//! // Load recovery file
20//! let recovery_file = std::fs::read("recovery.pkarr")?;
21//!
22//! // Create client
23//! let client = PrivateMessengerClient::from_recovery_file(&recovery_file, Some("passphrase"))?;
24//!
25//! // Sign in
26//! client.sign_in().await?;
27//!
28//! // Send a message
29//! let recipient = PublicKey::try_from("recipient_public_key")?;
30//! client.send_message(&recipient, "Hello, world!").await?;
31//!
32//! // Get messages
33//! let messages = client.get_messages(&recipient).await?;
34//! # Ok(())
35//! # }
36//! ```
37
38mod client;
39mod crypto;
40mod message;
41
42pub use client::{FollowedUser, PrivateMessengerClient, PubkyProfile};
43pub use message::{DecryptedMessage, PrivateMessage};
44
45pub use pkarr::{Keypair, PublicKey};
46pub use bip39::Language;