pub struct CircleKey { /* private fields */ }Expand description
One circle’s identified 32-byte key, introduced by creation or rotation (§12.1). Cloning supplies an independent unlocked snapshot to in-memory custody.
Implementations§
Source§impl CircleKey
impl CircleKey
Sourcepub const ENCODED_LEN: usize
pub const ENCODED_LEN: usize
The encoded key a box or custody holds: its circle, then its store-key encoding.
Sourcepub fn generate(circle: CircleId, id: KeyId) -> Result<CircleKey, CryptoError>
pub fn generate(circle: CircleId, id: KeyId) -> Result<CircleKey, CryptoError>
Make a circle key using the operating system’s randomness.
Sourcepub fn from_bytes(circle: CircleId, id: KeyId, bytes: [u8; 32]) -> CircleKey
pub fn from_bytes(circle: CircleId, id: KeyId, bytes: [u8; 32]) -> CircleKey
Import a circle key opened from custody or a member’s sealed copy.
Sourcepub fn circle(&self) -> CircleId
pub fn circle(&self) -> CircleId
The circle whose rows this key protects; file keys travel inside those rows.
Sourcepub fn hash(&self) -> [u8; 32]
pub fn hash(&self) -> [u8; 32]
SHA-256 of the exact key bytes, committed inside its introducing entry (§12.1).
Sourcepub fn check_hash(&self, expected: &[u8; 32]) -> Result<(), MaterialError>
pub fn check_hash(&self, expected: &[u8; 32]) -> Result<(), MaterialError>
Check the hash committed by an authorized introduction before accepting this key.
Sourcepub fn derive(&self) -> DerivedKeys
pub fn derive(&self) -> DerivedKeys
Derive separate encryption and authorship keys.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CircleKey
impl RefUnwindSafe for CircleKey
impl Send for CircleKey
impl Sync for CircleKey
impl Unpin for CircleKey
impl UnsafeUnpin for CircleKey
impl UnwindSafe for CircleKey
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.