awslabs / mls-rs

An implementation of Messaging Layer Security (RFC 9420)
Apache License 2.0
101 stars 19 forks source link

WIP [1.x] Externalize storage #211

Open tomleavy opened 4 days ago

tomleavy commented 4 days ago

Background:

As part of our 1.x goals, we want to externalize all storage objects that interact with mls-rs so internal functionality is not directly dependent on a user-provided storage mechanism.

Key Package Storage

Currently building a client requires that you provide an implementation of the KeyPackageStorage trait that we define in mls-rs-core. A Client uses this to maintain storage on your behalf when certain operations take place:

When a key package is generated with Client::generate_key_package_message, the Client will store the associated private key in the KeyPackageStorage implementation

When a group is joined with Client::join_group, the Client will first retrieve the private key that corresponds with the key package that was used to add it to the group and also delete that private key when the resulting Group is saved.

PSK Storage

PSK storage is currently set when building a client and is consumed whenever a PSK is required:

Group State Storage

Group State Storage is currently set when building a client and has three functions:

mulmarta commented 4 days ago

PSK is also used in Client::external_commit_builder