pub struct MemberKeys { /* private fields */ }Expand description
A member’s Ed25519 signing pair and independent X25519 sealing pair (Appendix D). Both secrets erase on drop. Clone is needed by in-memory custody to keep its keys while returning an independently owned unlocked pair.
Implementations§
Source§impl MemberKeys
impl MemberKeys
Sourcepub fn from_seed(seed: u8) -> Self
pub fn from_seed(seed: u8) -> Self
A pair whose signing and sealing seeds are both seed: public test
data, never a person’s keys.
Sourcepub fn generate() -> Result<Self, CryptoError>
pub fn generate() -> Result<Self, CryptoError>
Make both member key pairs using the operating system’s randomness.
Sourcepub fn public_keys(&self) -> MemberPublicKeys
pub fn public_keys(&self) -> MemberPublicKeys
The public pair admin entries bind to a stable member id (§10).
Sourcepub fn sign_object(&self, path: &str, digest: &ObjectDigest) -> Signature
pub fn sign_object(&self, path: &str, digest: &ObjectDigest) -> Signature
Sign the digest of every object byte before the signature (Appendix D.3).
Feed the prefix, length fields and sealed chunks to crate::ObjectHasher
in storage order. The signed message binds its domain, path and digest.
Panics if the storage path is empty.
A file’s content hash cannot stand in for an object’s digest.
use coven_crypto::{ContentHasher, MemberKeys};
let member = MemberKeys::generate().unwrap();
member.sign_object("10101010-1010-1010-1010-101010101010/seq/1", &ContentHasher::new().finish());Sourcepub fn sign_prefix(&self, path: &str, prefix: &[u8]) -> Signature
pub fn sign_prefix(&self, path: &str, prefix: &[u8]) -> Signature
Sign a snapshot’s exact kind, version and routing fields (D9). The prefix domain and path are bound separately from whole-object signing. Panics if the storage path is empty.
Sourcepub fn sign_write_header(
&self,
path: &str,
prefix: &[u8],
header: &[u8],
roots: &[[u8; 32]],
) -> Signature
pub fn sign_write_header( &self, path: &str, prefix: &[u8], header: &[u8], roots: &[[u8; 32]], ) -> Signature
Sign a write’s cleartext prefix, sealed header chunk and part roots (D9), separately from the whole-object signature. Panics if the storage path is empty.
Sourcepub fn to_secret_bytes(&self) -> SecretBytes
pub fn to_secret_bytes(&self) -> SecretBytes
Encode both private seeds for custody or the person’s restore code (§13.1).
Sourcepub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
pub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
Restore both pairs from custody or the person’s restore code (§13.1).
Sourcepub fn open_store_key(
&self,
path: &str,
prefix: &[u8],
sealed: &[u8],
) -> Result<StoreKey, CryptoError>
pub fn open_store_key( &self, path: &str, prefix: &[u8], sealed: &[u8], ) -> Result<StoreKey, CryptoError>
Open a store-key box, authenticating the exact path and opaque clear prefix. Format checks the recipient and opened identity; the caller checks the introduction commitment before accepting the candidate key. Panics if the storage path is empty.
Sourcepub fn open_circle_key(
&self,
path: &str,
prefix: &[u8],
sealed: &[u8],
) -> Result<CircleKey, CryptoError>
pub fn open_circle_key( &self, path: &str, prefix: &[u8], sealed: &[u8], ) -> Result<CircleKey, CryptoError>
Open a circle-key box, authenticating the exact path and opaque clear prefix. Format checks the recipient and opened identity; the caller checks the introduction commitment before accepting the candidate key. Panics if the storage path is empty.
Trait Implementations§
Source§impl Clone for MemberKeys
impl Clone for MemberKeys
Source§fn clone(&self) -> MemberKeys
fn clone(&self) -> MemberKeys
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more