Skip to content

[Feature request] Store key material in a Key Store #337

Closed

Description

@kkohbrok

Is your feature request related to a problem? Please describe.
Private key material is currently stored in individual groups and the consumer of the library has to manage CredentialBundles itself. I believe the storage of private key material (and the attached context) should really be handled by the library.

Describe the solution you'd like
There could be a Key Store component that stores private all key material. This allows us to store and manage it separately from the rest of the group states.

The Key Store is meant to be a part of OpenMLS, that interfaces with different components as follows:

  • Every MLS client maintains one or more key stores
  • Each ManagedGroup gets a reference to a key store upon creation and uses it to store/load key material. This allows the use of key material across groups. Note that group-specific key material should be marked as belonging to a specific group.
    • Note, that currently, each ManagedGroup manages its own key material and in particular its leaf KeyPackageBundle. This is problematic, as the KeyStore should be able to track which Credential is used by whom. This is so that the Key Store can ensure that no key material is deleted that is still in use.
  • Generally, the Key Store should allow create, read, delete operations (no update) for the individual categories of key material.
  • The Client could generate "init" KeyPackages for publication and later creation of a group, as well as Credentials. In both cases, the KeyStore would store the corresponding Bundles, such that the ManagedGroup can obtain the private key material when needed.
  • Later, we could extend the Key Store such that it stores any private key material in a group, including symmetric secrets, making it available for use in other groups or the Client.
  • The KeyStore should be thread safe, such that multiple groups can share CredentialBundles and still operate in parallel.
  • The KeyStore should keep track of which key material is used by whom, when it expires and when it is safe to delete (i.e. when it's not used by anyone anymore, or when it's expired for a reasonable amount of time).

This could happen in individual steps:

  • Introduce a simple key store that stores CredentialBundles in memory. Each ManagedGroup has access to the KeyStore, enabling us to share individual CredentialBundles across groups.
  • Enable the key store to manage KeyPackageBundles corresponding to prepublished "init" KeyPackages.
  • Make the KeyStore thread safe, such that it enables multiple concurrent reads.
  • Implement a persistence layer that allows the KeyStore to keep key material in memory (i.e. cache it), but also persist it safely.
  • We have to be careful to keep cached and persistent key material in sync. Since the Key Store doesn't provide a way to update key material, we don't have to worry about cached key material getting stale, at least as long as delete operations delete both persisted and cached copies of the target.
  • The key store also manages other key material previously stored in the group (this is eventually going to have a few sub-points, but it should do as a goal for now).
    • KeyPackageBundles of KeyPackages stored in the client's leaf
    • Resumption Secrets
    • PSKs

Activity

  1. added
    enhancement
    on Feb 5, 2021
  2. self-assigned this
    on Feb 5, 2021
  3. franziskuskiefer commented on Feb 8, 2021

    @franziskuskiefer
    Member

    The key store should be for all key material (not only private). I think we need a description of the basic architecture how it should look in the end in order to guide the way. This includes in particular a rough description of the API and ownership.

  4. changed the title [-][Feature request] Store private key material in a Key Store[/-] [+][Feature request] Store key material in a Key Store[/+] on Feb 10, 2021
  5. removed their assignment
    on Oct 8, 2021
  6. moved this to Triage needed in OpenMLS Libraryon Oct 5, 2022
  7. franziskuskiefer commented on Jan 5, 2023

    @franziskuskiefer
    Member

    Let's collect key store things here and clean up the description.
    Here are some items

    • Add a read-and-delete function
    • Make the key store async
    • Ensure the key store is only used in the entry function, i.e. not within the protocol code
  8. moved this from Triage needed to Done in OpenMLS Libraryon Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions