Module oo7::dbus

source · []
Expand description

A Secret Service implementation.

That is usually done with

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");

if let Some(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 item = collection.search_items(attributes).await?.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.