Expand description
MLS (Message Layer Security) integration for end-to-end encryption.
This module provides end-to-end encryption support using the MLS protocol. Messages can be encrypted before sending and decrypted after receiving, providing forward secrecy and post-compromise security.
§Architecture
The MLS integration uses a storage-agnostic design:
- Apps provide a storage implementation via the
MlsStoragetrait - The SDK handles all MLS protocol operations
- Encrypted messages are transported using the existing transport layer
§Usage
ⓘ
use offline_protocol::mls::{MlsManager, MlsStorage};
// Create storage (apps implement this for platform-native secure storage)
let storage = MySecureStorage::new();
// Create the MLS manager
let mls = MlsManager::new("user123", storage)?;
// Generate a key package to share with others
let key_package = mls.generate_key_package()?;
// Encrypt a message for another user
let encrypted = mls.encrypt_for_user("bob", b"Hello!")?;Modules§
- metadata_
keys - Metadata keys for MLS-encrypted messages.
Structs§
- Encrypted
Message - The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
- GroupId
- The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
- Group
Info - Information about an MLS group.
- Group
Metadata - Metadata about an MLS group (stored separately from MLS state).
- InMemory
Storage - In-memory storage implementation for testing.
- KeyPackage
Bundle - A bundle containing a key package and metadata for distribution.
- MlsManager
- Main MLS manager for end-to-end encryption.
- Welcome
Message - The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
Enums§
- MlsError
- Errors that can occur during MLS operations.
- MlsMessage
Type - The sealed-envelope types, re-exported so that every path into them keeps working and there is still exactly one definition of each.
- Storage
Error - Errors that can occur during storage operations.
Traits§
- MlsProtocol
Ext - Extension trait for integrating MLS with the protocol.
- MlsStorage
- Trait for MLS key material storage.
Functions§
- create_
manager - Creates an MLS manager with the given storage.
- decode_
from_ transport - Decodes an encrypted message from a base64-encoded string.
- encode_
for_ transport - Converts an MLS encrypted message to a base64-encoded string for transport.
Type Aliases§
- MlsResult
- Result type alias for MLS operations.