Expand description
A Secret Service implementation.
That is usually done with
use oo7::dbus::{Algorithm, Service};
let service = Service::new(Algorithm::Plain).await?;
let mut attributes = std::collections::HashMap::new();
attributes.insert("type", "password");
attributes.insert("user_id", "some_other_identifier");
let collection = service.default_collection().await?;
// Store a secret
collection
.create_item(
"My App's secret",
attributes.clone(),
b"password",
true,
"text/plain",
)
.await?;
// Retrieve it later thanks to it attributes
let items = collection.search_items(attributes).await?;
let item = items.first().unwrap();
assert_eq!(*item.secret().await?, b"password");
Structs
- A collection allows to store and retrieve items.
- A secret with a label and attributes to identify it.
- The entry point of communicating with a
org.freedesktop.Secrets
implementation.
Enums
- Algorithm used to start a new session.
- DBus Secret Service specific errors.
Statics
- The default collection alias.
- A session collection.