pub struct StoreKey { /* private fields */ }Expand description
A store’s identified 32-byte key (§12), erased on drop. Cloning supplies an independent unlocked snapshot to in-memory custody.
Implementations§
Source§impl StoreKey
impl StoreKey
Sourcepub const ENCODED_LEN: usize
pub const ENCODED_LEN: usize
The encoded key a box or custody holds: its id, then its 32 bytes.
Sourcepub fn generate(id: KeyId) -> Result<Self, CryptoError>
pub fn generate(id: KeyId) -> Result<Self, CryptoError>
Make random key material for an identity supplied by the id source.
Sourcepub fn from_bytes(id: KeyId, bytes: [u8; 32]) -> Self
pub fn from_bytes(id: KeyId, bytes: [u8; 32]) -> Self
Import a store key opened from custody or a member’s sealed copy (§12.1).
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 StoreKey
impl RefUnwindSafe for StoreKey
impl Send for StoreKey
impl Sync for StoreKey
impl Unpin for StoreKey
impl UnsafeUnpin for StoreKey
impl UnwindSafe for StoreKey
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