Struct jarida::CredentialGuard [−][src]
A type used to verify the username and password used to secure the database.
Implementations
impl CredentialGuard
[src]
pub fn new(salt: DbSalt, username: &str, password: &str) -> CredentialGuard
[src]
Generate a new CredentialGuard from the database’s unique salt and the user’s name and password.
pub fn update_credentials(&mut self, username: &str, password: &str)
[src]
Update the user’s name and password
pub fn try_decrypt_key(self, encrypted_key: Vec<u8>) -> Result<DataGuard, Self>
[src]
Try to decrypt the key using the current user’s name and password. If successful, this CredentialGuard is consumed and a DataGuard is returned, which can be used to encrypt/decrypt data. Upon failure, this guard is returned and the guard’s credentials should be updated before calling this function again.
pub fn generate_encrypted_key(&self) -> Result<Vec<u8>, UnspecifiedError>
[src]
Generate a randome symmetric encryption key for securing data. The key is encrypted using the user’s name and password and, as such, can be public.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CredentialGuard
impl Send for CredentialGuard
impl Sync for CredentialGuard
impl Unpin for CredentialGuard
impl UnwindSafe for CredentialGuard
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,