bitwarden_user_crypto_management/
user_crypto_management_client.rs

1//! Client to manage the cryptographic machinery of a user account, including key-rotation
2
3use bitwarden_core::Client;
4#[cfg(feature = "wasm")]
5use wasm_bindgen::prelude::*;
6
7/// Client for managing the cryptographic machinery of a user account, including key-rotation.
8#[derive(Clone)]
9#[cfg_attr(feature = "uniffi", derive(uniffi::Object))]
10#[cfg_attr(feature = "wasm", wasm_bindgen)]
11pub struct UserCryptoManagementClient {
12    #[allow(unused)]
13    pub(crate) client: Client,
14}
15
16impl UserCryptoManagementClient {
17    #[allow(unused)]
18    pub(crate) fn new(client: Client) -> Self {
19        Self { client }
20    }
21}
22
23/// Extension trait to add the user-crypto-management client to the main Bitwarden SDK client.
24pub trait UserCryptoManagementClientExt {
25    /// Get the user-crypto-management client.
26    fn user_crypto_management(&self) -> UserCryptoManagementClient;
27}
28
29impl UserCryptoManagementClientExt for Client {
30    fn user_crypto_management(&self) -> UserCryptoManagementClient {
31        UserCryptoManagementClient::new(self.clone())
32    }
33}