pub struct StoreKeyring { /* private fields */ }Expand description
Every store and circle key this device has opened, including older keys (§12.2). Cloning lets in-memory custody keep its copy while returning an unlocked one.
Implementations§
Source§impl StoreKeyring
impl StoreKeyring
Sourcepub fn new(key: StoreKey) -> Self
pub fn new(key: StoreKey) -> Self
Start with one opened store key. A keyring always holds a store key.
Sourcepub fn insert_store_key(&mut self, key: StoreKey) -> Result<(), MaterialError>
pub fn insert_store_key(&mut self, key: StoreKey) -> Result<(), MaterialError>
Keep an opened store key; a different key at the same id is an error.
Sourcepub fn insert_circle_key(&mut self, key: CircleKey) -> Result<(), MaterialError>
pub fn insert_circle_key(&mut self, key: CircleKey) -> Result<(), MaterialError>
Keep an opened circle key, retaining its earlier keys too (§15.5).
Sourcepub fn store_key(&self, key: KeyId) -> Result<&StoreKey, MaterialError>
pub fn store_key(&self, key: KeyId) -> Result<&StoreKey, MaterialError>
An opened store key by identity, so older writes still open (§12.2).
Sourcepub fn store_key_ids(&self) -> impl Iterator<Item = KeyId> + '_
pub fn store_key_ids(&self) -> impl Iterator<Item = KeyId> + '_
All held store-key identities, including keys preceding a member’s join.
Sourcepub fn circle_key_ids(
&self,
circle: CircleId,
) -> impl Iterator<Item = KeyId> + '_
pub fn circle_key_ids( &self, circle: CircleId, ) -> impl Iterator<Item = KeyId> + '_
All held keys for a circle, including concurrent and historical rotations.
Sourcepub fn circle_key(
&self,
circle: CircleId,
key: KeyId,
) -> Result<&CircleKey, MaterialError>
pub fn circle_key( &self, circle: CircleId, key: KeyId, ) -> Result<&CircleKey, MaterialError>
An opened circle key by its circle and identity (§15.5).
Sourcepub fn to_secret_bytes(&self) -> SecretBytes
pub fn to_secret_bytes(&self) -> SecretBytes
Encode every opened key for custody. The returned bytes remain secret.
Sourcepub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
pub fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
Decode custody bytes, rejecting malformed, duplicate or empty keyrings.
Trait Implementations§
Source§impl Clone for StoreKeyring
impl Clone for StoreKeyring
Source§impl Debug for StoreKeyring
impl Debug for StoreKeyring
Source§impl KeyMaterial for StoreKeyring
impl KeyMaterial for StoreKeyring
Source§const ENTRY: &'static str = "store-keys"
const ENTRY: &'static str = "store-keys"
Source§fn to_secret_bytes(&self) -> SecretBytes
fn to_secret_bytes(&self) -> SecretBytes
Source§fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
fn from_secret_bytes(bytes: &[u8]) -> Result<Self, MaterialError>
to_secret_bytes encoded.