Skip to content

Durable Keys#191

Open
expede wants to merge 15 commits intomainfrom
durable-keys-v2
Open

Durable Keys#191
expede wants to merge 15 commits intomainfrom
durable-keys-v2

Conversation

@expede
Copy link
Copy Markdown
Member

@expede expede commented Mar 28, 2026

Use a persistent key cache. Disk, HSM, WebCrypto, etc etc

Base automatically changed from sendable to main April 1, 2026 23:49
@expede expede force-pushed the durable-keys-v2 branch from 5f2381a to 4752461 Compare April 2, 2026 00:38
@expede expede marked this pull request as ready for review April 2, 2026 00:38
@expede expede requested review from alexjg, ept, jtfmumm and pvh as code owners April 2, 2026 00:38
Copilot AI review requested due to automatic review settings April 2, 2026 00:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new secret-key storage abstraction intended to support “durable keys” (disk/HSM/WebCrypto/etc.) by plumbing a SecretKeyStore type parameter through the Keyhive core types and adding initial store implementations (in-memory for core, IndexedDB-backed for wasm).

Changes:

  • Added SecretKeyStore (core) and MemorySecretKeyStore as the default in-memory implementation.
  • Added AsyncSecretKey trait (crypto) to support opaque/non-extractable secret-key handles and async ECDH operations.
  • Threaded the SecretKeyStore type parameter through core principals/events/listeners, updated tests/benches, and added a wasm IndexedDB-backed JsSecretKeyStore scaffold.

Reviewed changes

Copilot reviewed 57 out of 57 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
keyhive_wasm/src/js/signed_revocation.rs Plumb JsSecretKeyStore into types
keyhive_wasm/src/js/signed_invocation.rs Plumb JsSecretKeyStore into types
keyhive_wasm/src/js/signed_delegation.rs Plumb JsSecretKeyStore into types
keyhive_wasm/src/js/secret_key_store.rs New IndexedDB-backed store (Rust)
keyhive_wasm/src/js/secret_key_store_idb.js New IndexedDB helper (JS)
keyhive_wasm/src/js/revocation.rs Add store type param
keyhive_wasm/src/js/peer.rs Add store type param
keyhive_wasm/src/js/membership.rs Add store type param
keyhive_wasm/src/js/membered.rs Add store type param
keyhive_wasm/src/js/keyhive.rs InnerKeyhive now uses JsSecretKeyStore
keyhive_wasm/src/js/invocation.rs Add store type param
keyhive_wasm/src/js/history.rs Add store type param
keyhive_wasm/src/js/group.rs Add store type param
keyhive_wasm/src/js/event.rs Add store type param
keyhive_wasm/src/js/event_handler.rs Listener trait param updated
keyhive_wasm/src/js/document.rs Add store type param
keyhive_wasm/src/js/delegation.rs Add store type param
keyhive_wasm/src/js/capability.rs Add store type param
keyhive_wasm/src/js/archive.rs Archive errors param updated
keyhive_wasm/src/js/agent.rs Add store type param
keyhive_wasm/src/js.rs Export new wasm module
keyhive_crypto/src/share_key.rs Add AsyncSecretKey + from_bytes
keyhive_core/tests/encrypt.rs Update generics/store types in tests
keyhive_core/src/test_utils.rs Update helper Keyhive type params
keyhive_core/src/store/secret_key/memory.rs New in-memory store implementation
keyhive_core/src/store/secret_key.rs New SecretKeyStore trait
keyhive_core/src/store/revocation.rs Add store type param
keyhive_core/src/store/delegation.rs Add store type param
keyhive_core/src/store.rs Export store::secret_key
keyhive_core/src/principal/public.rs Plumb store type param
keyhive_core/src/principal/peer.rs Plumb store type param
keyhive_core/src/principal/membered.rs Plumb store type param
keyhive_core/src/principal/group/state.rs Plumb store type param
keyhive_core/src/principal/group/revocation.rs Plumb store type param
keyhive_core/src/principal/group/membership_operation.rs Plumb store type param
keyhive_core/src/principal/group/dependencies.rs Plumb store type param
keyhive_core/src/principal/group/delegation.rs Plumb store type param
keyhive_core/src/principal/group.rs Plumb store type param
keyhive_core/src/principal/document.rs Plumb store type param
keyhive_core/src/principal/agent.rs Plumb store type param
keyhive_core/src/principal/active.rs Add store type param to Active
keyhive_core/src/listener/no_listener.rs Listener trait param updated
keyhive_core/src/listener/membership.rs Listener trait param updated
keyhive_core/src/listener/log.rs Plumb store type param
keyhive_core/src/listener/deque.rs Plumb store type param
keyhive_core/src/keyhive.rs Plumb store type param through Keyhive
keyhive_core/src/invocation.rs Plumb store type param
keyhive_core/src/event.rs Plumb store type param
keyhive_core/src/debug_events/terminal.rs Update doc example generics
keyhive_core/src/debug_events.rs Update debug table generics
keyhive_core/src/crypto/signed_ext.rs Plumb store type param
keyhive_core/src/ability.rs Plumb store type param
keyhive_core/benches/bench_utils.rs Update bench type aliases
keyhive_core/benches/bench_toggling_delegate_revoke.rs Update bench generics
keyhive_core/benches/bench_reverse_topsort.rs Update bench generics
keyhive_core/benches/bench_reachable_prekey_ops.rs Update bench generics
keyhive_core/benches/bench_cgka_propagation.rs Update bench generics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
Comment thread keyhive_core/src/principal/active.rs
Comment thread keyhive_core/src/principal/active.rs
Comment thread keyhive_wasm/src/js/secret_key_store.rs Outdated
@expede expede changed the title Durable keys v2 Durable Keys Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants