pub struct EncryptedStorageManager { /* private fields */ }Expand description
Main encrypted storage manager
Implementations§
Source§impl EncryptedStorageManager
impl EncryptedStorageManager
Sourcepub async fn new(config: StorageConfig) -> Result<Self>
pub async fn new(config: StorageConfig) -> Result<Self>
Create a new encrypted storage manager
Sourcepub async fn create_vault(
&self,
four_words: &str,
password: &str,
display_name: &str,
) -> Result<String>
pub async fn create_vault( &self, four_words: &str, password: &str, display_name: &str, ) -> Result<String>
Create a new vault for a four-word identity
Sourcepub async fn login_password_only(&self, password: &str) -> Result<Session>
pub async fn login_password_only(&self, password: &str) -> Result<Session>
Login with password only (searches all vaults)
Sourcepub async fn login(
&self,
four_words: &str,
password: &str,
_passkey: Option<Vec<u8>>,
) -> Result<Session>
pub async fn login( &self, four_words: &str, password: &str, _passkey: Option<Vec<u8>>, ) -> Result<Session>
Login with four-word address and password
Sourcepub async fn store(
&self,
session_id: &str,
key: &str,
data: &[u8],
use_fec: bool,
) -> Result<()>
pub async fn store( &self, session_id: &str, key: &str, data: &[u8], use_fec: bool, ) -> Result<()>
Store encrypted data in a vault
Sourcepub async fn retrieve(&self, session_id: &str, key: &str) -> Result<Vec<u8>>
pub async fn retrieve(&self, session_id: &str, key: &str) -> Result<Vec<u8>>
Retrieve encrypted data from a vault
Sourcepub async fn list_vaults(&self) -> Result<Vec<VaultInfo>>
pub async fn list_vaults(&self) -> Result<Vec<VaultInfo>>
List all available vaults on this device
Sourcepub async fn switch_account(
&self,
session_id: &str,
four_words: &str,
) -> Result<Session>
pub async fn switch_account( &self, session_id: &str, four_words: &str, ) -> Result<Session>
Switch to a different account
Sourcepub async fn export_vault(
&self,
session_id: &str,
include_data: bool,
) -> Result<Vec<u8>>
pub async fn export_vault( &self, session_id: &str, include_data: bool, ) -> Result<Vec<u8>>
Export vault for backup
Sourcepub async fn import_vault(
&self,
backup_data: &[u8],
password: &str,
) -> Result<String>
pub async fn import_vault( &self, backup_data: &[u8], password: &str, ) -> Result<String>
Import vault from backup
Sourcepub async fn get_app_config(&self) -> AppConfig
pub async fn get_app_config(&self) -> AppConfig
Get app configuration
Sourcepub async fn try_auto_login(&self) -> Result<Option<Session>>
pub async fn try_auto_login(&self) -> Result<Option<Session>>
Try auto-login with last used identity
Sourcepub async fn set_auto_login_enabled(&self, enabled: bool) -> Result<()>
pub async fn set_auto_login_enabled(&self, enabled: bool) -> Result<()>
Update app configuration setting
Sourcepub async fn set_keyring_enabled(&self, enabled: bool) -> Result<()>
pub async fn set_keyring_enabled(&self, enabled: bool) -> Result<()>
Update keyring setting
Sourcepub async fn get_recent_identities(&self) -> Vec<RecentIdentity>
pub async fn get_recent_identities(&self) -> Vec<RecentIdentity>
Get recent identities
Sourcepub async fn remove_recent_identity(&self, four_words: &str) -> Result<()>
pub async fn remove_recent_identity(&self, four_words: &str) -> Result<()>
Remove a recent identity from the list (does not delete the vault)
Sourcepub async fn passkey_register(
&self,
four_words: &str,
device_name: &str,
) -> Result<PasskeyInfo>
pub async fn passkey_register( &self, four_words: &str, device_name: &str, ) -> Result<PasskeyInfo>
Register passkey/biometric for an identity
Sourcepub async fn passkey_register_webauthn(
&self,
four_words: &str,
device_name: &str,
credential: WebAuthnCredential,
) -> Result<PasskeyInfo>
pub async fn passkey_register_webauthn( &self, four_words: &str, device_name: &str, credential: WebAuthnCredential, ) -> Result<PasskeyInfo>
Register passkey with WebAuthn credential
This stores the WebAuthn credential for true biometric authentication.
Sourcepub async fn passkey_authenticate(&self, four_words: &str) -> Result<Session>
pub async fn passkey_authenticate(&self, four_words: &str) -> Result<Session>
Authenticate with passkey/biometric and create session
This uses the password stored in keyring after biometric verification
Sourcepub async fn passkey_has_passkey(&self, four_words: &str) -> bool
pub async fn passkey_has_passkey(&self, four_words: &str) -> bool
Check if passkey is registered for identity
Sourcepub async fn passkey_get_info(&self, four_words: &str) -> Result<PasskeyInfo>
pub async fn passkey_get_info(&self, four_words: &str) -> Result<PasskeyInfo>
Get passkey information
Sourcepub async fn passkey_delete(&self, four_words: &str) -> Result<()>
pub async fn passkey_delete(&self, four_words: &str) -> Result<()>
Delete passkey for identity
Sourcepub async fn delete_vault(&self, four_words: &str) -> Result<()>
pub async fn delete_vault(&self, four_words: &str) -> Result<()>
Delete a vault permanently
WARNING: This permanently deletes all encrypted data for this identity.
Sourcepub async fn store_password_in_keyring(
&self,
four_words: &str,
password: &str,
) -> Result<()>
pub async fn store_password_in_keyring( &self, four_words: &str, password: &str, ) -> Result<()>
Store password in platform keyring (for auto-login)
Sourcepub async fn remove_password_from_keyring(&self, four_words: &str) -> Result<()>
pub async fn remove_password_from_keyring(&self, four_words: &str) -> Result<()>
Remove password from platform keyring