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.
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 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 items(&self) -> Result<Vec<Item>>
pub async fn items(&self) -> Result<Vec<Item>>
Retrieve all the items.
If using the Secret Service, it will retrieve all the items in the
DEFAULT_COLLECTION
.
sourcepub async fn create_item(
&self,
label: &str,
attributes: &impl AsAttributes,
secret: impl AsRef<[u8]>,
replace: bool
) -> Result<()>
pub async fn create_item( &self, label: &str, attributes: &impl AsAttributes, secret: impl AsRef<[u8]>, 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.