Module ashpd::desktop::secret[][src]

Expand description

Retrieve a per-application secret used to encrypt confidential data inside the sandbox.

Examples

use ashpd::desktop::secret::SecretProxy;
use std::fs::File;
use std::os::unix::io::AsRawFd;
use zvariant::Fd;

async fn run() -> Result<(), ashpd::Error> {
    let connection = zbus::azync::Connection::new_session().await?;
    let proxy = SecretProxy::new(&connection).await?;

    let file = File::open("test.txt").unwrap();

    let secret = proxy
        .retrieve_secret(Fd::from(file.as_raw_fd()), None)
        .await?;

    println!("{:#?}", secret);
    Ok(())
}

Structs

SecretProxy

The interface lets sandboxed applications retrieve a per-application secret. The secret can then be used for encrypting confidential data inside the sandbox.