14 releases

0.1.0-alpha.15 Nov 17, 2022
0.1.0-alpha.12 Jun 23, 2022
0.1.0-alpha.11 Feb 28, 2022
0.1.0-alpha.9 Jan 5, 2022
0.1.0-alpha.3 Oct 28, 2021

#5 in #full-file

Download history 3/week @ 2023-11-09 15/week @ 2023-11-16 17/week @ 2023-11-23 44/week @ 2023-11-30 65/week @ 2023-12-07 30/week @ 2023-12-14 45/week @ 2023-12-21 62/week @ 2023-12-28 24/week @ 2024-01-04 21/week @ 2024-01-11 24/week @ 2024-01-18 29/week @ 2024-01-25 29/week @ 2024-02-01 9/week @ 2024-02-08 118/week @ 2024-02-15 459/week @ 2024-02-22

615 downloads per month

MPL-2.0 license

31KB
570 lines

keyring-rs

A library to interact with your keyring on Linux, Mac, or Windows.

Crates.io Crates.io

Keyring Backends:

Example

See example.rs for the full file.

use anyhow::{Result, anyhow};
use tmuntaner_keyring::KeyringClient;

fn main() -> Result<()> {
    let username = "tmuntaner";
    let service = "keyring-rs-example";
    let application = "keyring-rs";

    let keyring = KeyringClient::new(username, service, application)?;
    let password = String::from("foobar");

    println!("Setting password {}", password);
    keyring.set_password(password.clone())?;

    let result = keyring.get_password()?.ok_or_else(|| anyhow!("should have a password"))?;
    println!("Returned password: {}", password);
    assert_eq!(password, result);

    Ok(())
}

Dependencies

~0.1–49MB
~714K SLoC