Skip to main content

Module keystore

Module keystore 

Source
Expand description

AES-256-GCM encrypted Ed25519 key store with Argon2id key derivation.

Keys are stored as JSON on disk, encrypted per-record with a unique nonce. Rotation archives the current key and generates a fresh one; revocation marks a key as compromised so it is excluded from the published DID document.

§Module layout

  • entryKeyEntry, the decrypted in-memory key handed back to callers.
  • storeKeyStore itself: the encrypted record map and its open/generate/load/persist paths.
  • crypto, rotation, migration — key derivation, rotation, and legacy-KDF migration, each already a focused file.

Structs§

KeyEntry
algorithm is carried alongside the key material so signing and verification read it from the key rather than assuming it. The material itself is Ed25519-typed because Ed25519 is the only algorithm this store issues; the struct is #[non_exhaustive] so that can change without breaking downstream construction.
KeyStore
Thread-safe store that loads, encrypts, and caches Ed25519 signing keys.
PublicKeyInfo
A key’s public half plus its revocation state, read directly from the stored record’s plaintext verifying_key_hex/revoked fields — no private-key decryption involved. For callers (like the did:web document builder in dpp-vc) that only ever need the public key, this avoids an AES-GCM decrypt per key on every call.