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) -> StoreKeyring
pub fn new(key: StoreKey) -> StoreKeyring
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<StoreKeyring, MaterialError>
pub fn from_secret_bytes(bytes: &[u8]) -> Result<StoreKeyring, MaterialError>
Decode custody bytes, rejecting malformed, duplicate or empty keyrings.
Trait Implementations§
Source§impl Clone for StoreKeyring
impl Clone for StoreKeyring
Source§fn clone(&self) -> StoreKeyring
fn clone(&self) -> StoreKeyring
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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<StoreKeyring, MaterialError>
fn from_secret_bytes(bytes: &[u8]) -> Result<StoreKeyring, MaterialError>
to_secret_bytes encoded.Auto Trait Implementations§
impl Freeze for StoreKeyring
impl RefUnwindSafe for StoreKeyring
impl Send for StoreKeyring
impl Sync for StoreKeyring
impl Unpin for StoreKeyring
impl UnsafeUnpin for StoreKeyring
impl UnwindSafe for StoreKeyring
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more