pub struct MasterKey { /* private fields */ }Expand description
A master key used for deriving other keys.
Master keys are typically generated during vault initialization and protected by Shamir’s Secret Sharing.
Implementations§
Source§impl MasterKey
impl MasterKey
Sourcepub fn generate() -> Result<Self, CryptoError>
pub fn generate() -> Result<Self, CryptoError>
Generates a new random master key.
§Errors
Returns a CryptoError::RandomGenerationFailed if the operating
system’s CSPRNG fails to produce output.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, CryptoError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, CryptoError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MasterKey
impl RefUnwindSafe for MasterKey
impl Send for MasterKey
impl Sync for MasterKey
impl Unpin for MasterKey
impl UnsafeUnpin for MasterKey
impl UnwindSafe for MasterKey
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