Module oo7::dbus

source ·
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

Enums

  • Algorithm used to start a new session.
  • DBus Secret Service specific errors.

Statics