Skip to main content

EncryptedStorageManager

Struct EncryptedStorageManager 

Source
pub struct EncryptedStorageManager { /* private fields */ }
Expand description

Main encrypted storage manager

Implementations§

Source§

impl EncryptedStorageManager

Source

pub async fn new(config: StorageConfig) -> Result<Self>

Create a new encrypted storage manager

Source

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

Source

pub async fn login_password_only(&self, password: &str) -> Result<Session>

Login with password only (searches all vaults)

Source

pub async fn login( &self, four_words: &str, password: &str, _passkey: Option<Vec<u8>>, ) -> Result<Session>

Login with four-word address and password

Source

pub async fn store( &self, session_id: &str, key: &str, data: &[u8], use_fec: bool, ) -> Result<()>

Store encrypted data in a vault

Source

pub async fn retrieve(&self, session_id: &str, key: &str) -> Result<Vec<u8>>

Retrieve encrypted data from a vault

Source

pub async fn list_vaults(&self) -> Result<Vec<VaultInfo>>

List all available vaults on this device

Source

pub async fn switch_account( &self, session_id: &str, four_words: &str, ) -> Result<Session>

Switch to a different account

Source

pub async fn logout(&self, session_id: &str) -> Result<()>

Logout and clear session

Source

pub async fn export_vault( &self, session_id: &str, include_data: bool, ) -> Result<Vec<u8>>

Export vault for backup

Source

pub async fn import_vault( &self, backup_data: &[u8], password: &str, ) -> Result<String>

Import vault from backup

Source

pub async fn get_app_config(&self) -> AppConfig

Get app configuration

Source

pub async fn try_auto_login(&self) -> Result<Option<Session>>

Try auto-login with last used identity

Source

pub async fn set_auto_login_enabled(&self, enabled: bool) -> Result<()>

Update app configuration setting

Source

pub async fn set_keyring_enabled(&self, enabled: bool) -> Result<()>

Update keyring setting

Source

pub async fn get_recent_identities(&self) -> Vec<RecentIdentity>

Get recent identities

Source

pub async fn remove_recent_identity(&self, four_words: &str) -> Result<()>

Remove a recent identity from the list (does not delete the vault)

Source

pub async fn passkey_register( &self, four_words: &str, device_name: &str, ) -> Result<PasskeyInfo>

Register passkey/biometric for an identity

Source

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.

Source

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

Source

pub async fn passkey_has_passkey(&self, four_words: &str) -> bool

Check if passkey is registered for identity

Source

pub async fn passkey_get_info(&self, four_words: &str) -> Result<PasskeyInfo>

Get passkey information

Source

pub async fn passkey_delete(&self, four_words: &str) -> Result<()>

Delete passkey for identity

Source

pub async fn delete_vault(&self, four_words: &str) -> Result<()>

Delete a vault permanently

WARNING: This permanently deletes all encrypted data for this identity.

Source

pub async fn store_password_in_keyring( &self, four_words: &str, password: &str, ) -> Result<()>

Store password in platform keyring (for auto-login)

Source

pub async fn remove_password_from_keyring(&self, four_words: &str) -> Result<()>

Remove password from platform keyring

Source

pub async fn vault_exists(&self, four_words: &str) -> Result<bool>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more