#keychain #operating-system #libsecret #credential-vault

keytar

keytar bindings to safely interact with operating system keychains

5 releases

0.1.6 Sep 4, 2021
0.1.5 Sep 4, 2021
0.1.4 Aug 2, 2021
0.1.3 Sep 2, 2020
0.1.1 May 31, 2020

#316 in Authentication

Download history 807/week @ 2023-12-17 458/week @ 2023-12-24 857/week @ 2023-12-31 931/week @ 2024-01-07 527/week @ 2024-01-14 748/week @ 2024-01-21 856/week @ 2024-01-28 633/week @ 2024-02-04 428/week @ 2024-02-11 595/week @ 2024-02-18 470/week @ 2024-02-25 550/week @ 2024-03-03 482/week @ 2024-03-10 442/week @ 2024-03-17 399/week @ 2024-03-24 583/week @ 2024-03-31

1,923 downloads per month

MIT license

55KB
1.5K SLoC

C++ 1K SLoC // 0.0% comments JavaScript 205 SLoC Rust 52 SLoC PowerShell 24 SLoC // 0.1% comments TypeScript 4 SLoC // 0.9% comments

keytar-rs

crates.io page docs.rs page build license: MIT

keytar bindings for Rust

A native Node module to get, add, replace, and delete passwords in system's keychain. On macOS the passwords are managed by the Keychain, on Linux they are managed by the Secret Service API/libsecret, and on Windows they are managed by Credential Vault.

let service = "service";
let account = "account";
let password = "password";

keytar::set_password(service, account, password).unwrap();

Linux Requirement

Currently this library uses libsecret. Depending on your distribution, you will need to install the appropriate package, e.g.:

  • Debian/Ubuntu: sudo apt-get install libsecret-1-dev
  • Red Hat-based: sudo yum install libsecret-devel
  • Arch Linux: sudo pacman -S libsecret

Dependencies

~0.6–1.4MB
~28K SLoC