pub struct KeyStore { /* private fields */ }Implementations§
Source§impl KeyStore
impl KeyStore
Sourcepub async fn apply_mask(&self, mask: &Mask, next_gen: u16) -> Result<(), Error>
pub async fn apply_mask(&self, mask: &Mask, next_gen: u16) -> Result<(), Error>
Creates a new generation from a password mask.
Sourcepub async fn is_initialized(&self) -> bool
pub async fn is_initialized(&self) -> bool
Checks if the keystore is initialized.
Sourcepub async fn initialize(
&self,
dk: &DeviceKey,
pass: &Password,
force: bool,
) -> Result<(), Error>
pub async fn initialize( &self, dk: &DeviceKey, pass: &Password, force: bool, ) -> Result<(), Error>
Initializes the keystore.
Sourcepub async fn unlock(&self, pass: &Password) -> Result<DeviceKey, Error>
pub async fn unlock(&self, pass: &Password) -> Result<DeviceKey, Error>
Unlocking the keystore makes the random key decryptable.
Sourcepub async fn lock(&self) -> Result<(), Error>
pub async fn lock(&self) -> Result<(), Error>
Locks the keystore by zeroizing the noise file. This makes the encrypted random key undecryptable without a password.
Sourcepub async fn device_key(&self) -> Result<DeviceKey, Error>
pub async fn device_key(&self) -> Result<DeviceKey, Error>
The random key is used to decrypt the device key.
NOTE: Only works if the keystore was unlocked.
Auto Trait Implementations§
impl !Freeze for KeyStore
impl !RefUnwindSafe for KeyStore
impl Send for KeyStore
impl Sync for KeyStore
impl Unpin for KeyStore
impl UnwindSafe for KeyStore
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> 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 more