Expand description
FFI surface for the Store crate.
Exposes the cfm_keystore_* C ABI. The wire protocol mirrors
TODO.finalize/12-keystore-interface.md. Key material is opaque
(*mut c_void) — the Store never interprets key bytes, it only
indexes and returns handles owned by the caller (typically the
Engine’s keyfmt interface).
Entry points follow the conventions established by confium-core’s
FFI layer: raw-pointer parameters, null-checked on entry, and a
u32 result encoding either 0 for success or a numeric
crate::error::ErrorCode.
Structs§
- KeyIterator
- Backing storage for an iterator handle. Owns a
Vecsnapshot taken at enumerate time — iteration does not hold a borrow on the keystore, so the caller may continue mutating the store while iterating over a past snapshot.
Enums§
- FFIKey
Iterator - Opaque key iterator handle.
- FFIKeystore
- Opaque handle returned to C callers. Never dereferenced by C; only passed back into the FFI.
Functions§
- cfm_
keystore_ create - Create a keystore backed by
backend_name(e.g."memory"). - cfm_
keystore_ destroy - Drop a keystore handle. Safe to call with
NULL. - cfm_
keystore_ enumerate - Enumerate entries in one compartment of one
(module, app)scope. - cfm_
keystore_ get_ public - Fetch a public key from the public compartment by identity.
- cfm_
keystore_ get_ secret - Fetch a secret key from the private compartment.
- cfm_
keystore_ iterator_ destroy - Drop an iterator handle. Safe to call with
NULL. - cfm_
keystore_ iterator_ next - Advance the iterator. Returns
0and writes the next key handle into*out, orError::ValueNotFoundwhen the iterator is exhausted (in which case*outis left untouched). - cfm_
keystore_ put_ public - Insert a public key into the public compartment with a detached identity signature.
- cfm_
keystore_ put_ secret - Insert a secret key into the private compartment.
- cfm_
keystore_ ⚠sign - Out-buffer convention for byte results: the caller passes a
destination pointer plus its capacity; on success
outreceives a freshly heap-allocated buffer (freed withCFM_FREEsemantics by the embedding engine) andout_lenits length.
Type Aliases§
- FFIKey
- Opaque key handle. The Store treats this as a caller-owned token; it stores and returns the pointer verbatim and never dereferences it.