pub enum Keyring {
// some variants omitted
}
Expand description
A Secret Service or file backed keyring implementation.
It will automatically use the file backend if the application is sandboxed and otherwise falls back to the DBus service using it default collection.
The File backend requires a org.freedesktop.portal.Secret
implementation
to retrieve the key that will be used to encrypt the backend file.
Implementations§
Source§impl Keyring
impl Keyring
Sourcepub async fn with_broken_item_cleanup() -> Result<Self>
👎Deprecated: The method is no longer useful as the user can fix the keyring using oo7-cli
pub async fn with_broken_item_cleanup() -> Result<Self>
Create a new instance of the Keyring that automatically removes the broken items from the file backend keyring.
This method will probably be removed in future versions if the misbehaviour is tracked and fixed.
Sourcepub async fn unlock(&self) -> Result<()>
pub async fn unlock(&self) -> Result<()>
Unlock the used collection if using the Secret service.
The method does nothing if keyring is backed by a file backend.
Sourcepub async fn lock(&self) -> Result<()>
pub async fn lock(&self) -> Result<()>
Lock the used collection if using the Secret service.
The method does nothing if keyring is backed by a file backend.
Sourcepub async fn delete(&self, attributes: &impl AsAttributes) -> Result<()>
pub async fn delete(&self, attributes: &impl AsAttributes) -> Result<()>
Remove items that matches the attributes.
Sourcepub async fn create_item(
&self,
label: &str,
attributes: &impl AsAttributes,
secret: impl Into<Secret>,
replace: bool,
) -> Result<()>
pub async fn create_item( &self, label: &str, attributes: &impl AsAttributes, secret: impl Into<Secret>, replace: bool, ) -> Result<()>
Create a new item.
Sourcepub async fn search_items(
&self,
attributes: &impl AsAttributes,
) -> Result<Vec<Item>>
pub async fn search_items( &self, attributes: &impl AsAttributes, ) -> Result<Vec<Item>>
Find items based on their attributes.
Sourcepub fn as_file(&self) -> Arc<Keyring>
pub fn as_file(&self) -> Arc<Keyring>
Get the inner file backend if the keyring is backed by one.
Sourcepub fn as_dbus(&self) -> &Collection<'_>
pub fn as_dbus(&self) -> &Collection<'_>
Get the inner DBus backend if the keyring is backed by one.