bitwarden_uniffi/vault/
password_history.rs

1use bitwarden_vault::{PasswordHistory, PasswordHistoryView};
2
3use crate::{error::Error, Result};
4
5#[allow(missing_docs)]
6#[derive(uniffi::Object)]
7pub struct PasswordHistoryClient(pub(crate) bitwarden_vault::PasswordHistoryClient);
8
9#[uniffi::export]
10impl PasswordHistoryClient {
11    /// Encrypt password history
12    pub fn encrypt(&self, password_history: PasswordHistoryView) -> Result<PasswordHistory> {
13        Ok(self.0.encrypt(password_history).map_err(Error::Encrypt)?)
14    }
15
16    /// Decrypt password history
17    pub fn decrypt_list(&self, list: Vec<PasswordHistory>) -> Result<Vec<PasswordHistoryView>> {
18        Ok(self.0.decrypt_list(list).map_err(Error::Decrypt)?)
19    }
20}