Crate signal_bridge

Crate signal_bridge 

Source
Expand description

Signal Protocol integration for Radix Relay

This crate provides a bridge between Radix Relay’s C++ transport layer and the official Signal Protocol Rust implementation for end-to-end encryption.

Re-exports§

pub use key_rotation::cleanup_expired_kyber_pre_keys;
pub use key_rotation::cleanup_expired_signed_pre_keys;
pub use key_rotation::consume_pre_key;
pub use key_rotation::kyber_pre_key_needs_rotation;
pub use key_rotation::replenish_pre_keys;
pub use key_rotation::rotate_kyber_pre_key;
pub use key_rotation::rotate_signed_pre_key;
pub use key_rotation::signed_pre_key_needs_rotation;
pub use key_rotation::GRACE_PERIOD_SECS;
pub use key_rotation::MIN_PRE_KEY_COUNT;
pub use key_rotation::REPLENISH_COUNT;
pub use key_rotation::ROTATION_INTERVAL_SECS;
pub use message_history::Conversation;
pub use message_history::DeliveryStatus;
pub use message_history::MessageDirection;
pub use message_history::MessageHistory;
pub use message_history::MessageType;
pub use message_history::StoredMessage;
pub use memory_storage::MemoryStorage;
pub use sqlite_storage::SqliteStorage;
pub use storage_trait::ExtendedIdentityStore;
pub use storage_trait::ExtendedKyberPreKeyStore;
pub use storage_trait::ExtendedPreKeyStore;
pub use storage_trait::ExtendedSessionStore;
pub use storage_trait::ExtendedSignedPreKeyStore;
pub use storage_trait::ExtendedStorageOps;
pub use storage_trait::SignalStorageContainer;

Modules§

key_rotation
Key rotation functionality for Signal Protocol keys
memory_storage
In-memory storage implementation for libsignal
message_history
Message history storage and retrieval
sqlite_storage
SQLite storage implementation for libsignal
storage_trait
Storage trait definitions for libsignal

Structs§

ContactInfo
Information about a known contact/peer
ContactManager
Manages contact database operations separate from Signal Protocol
DecryptionResult
Result of decrypting an incoming message
KeyMaintenanceResult
Result of key maintenance operations indicating which keys were rotated/replenished
NostrIdentity
Nostr identity derivation utilities
SignalBridge
Main bridge between C++ and Rust Signal Protocol implementation

Enums§

SignalBridgeError
Errors that can occur in the Signal Protocol bridge

Functions§

add_contact_and_establish_session
Adds a contact from a bundle and establishes a session
add_contact_and_establish_session_from_base64
Adds a contact from a base64-encoded bundle and establishes a session
assign_contact_alias
Assigns an alias to a contact
clear_all_sessions
Clears all Signal Protocol sessions
clear_peer_session
Clears the Signal Protocol session with a specific peer
create_and_sign_encrypted_message
Creates and signs a Nostr encrypted message event
create_subscription_for_self
Creates a Nostr subscription filter for messages to this node
decrypt_message
Decrypts an incoming Signal Protocol message
delete_conversation
Deletes an entire conversation and all its messages
delete_message
Deletes a message by ID
encrypt_message
Encrypts a message for a peer using Signal Protocol
establish_session
Establishes a Signal Protocol session from a prekey bundle
extract_rdx_from_bundle
Extracts RDX fingerprint from a prekey bundle without adding contact
extract_rdx_from_bundle_base64
Extracts RDX fingerprint from a base64-encoded prekey bundle
generate_empty_bundle_announcement
Generates an empty bundle announcement for unpublishing
generate_node_fingerprint
Returns this node’s RDX fingerprint
generate_pre_key_bundle
Generates a new prekey bundle with metadata for publishing
generate_prekey_bundle_announcement
Generates a signed prekey bundle announcement
get_conversation_messages
Retrieves messages for a conversation with pagination
get_conversations
Retrieves all conversations ordered by recent activity
get_unread_count
Gets the unread message count for a conversation
list_contacts
Lists all known contacts
lookup_contact
Looks up a contact by RDX fingerprint or alias
mark_conversation_read
Marks a conversation as read (clears unread count)
new_signal_bridge
Creates a new Signal Protocol bridge with SQLite storage
perform_key_maintenance
Performs periodic key rotation and cleanup
record_published_bundle
Records a published bundle to track used keys
reset_identity
Resets the node’s Signal Protocol identity (generates new identity key)
sign_nostr_event
Signs a Nostr event with node’s private key
update_last_message_timestamp
Updates the timestamp of the last received message