#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

#430 in Authentication

Download history 548/week @ 2024-07-21 389/week @ 2024-07-28 380/week @ 2024-08-04 393/week @ 2024-08-11 664/week @ 2024-08-18 679/week @ 2024-08-25 552/week @ 2024-09-01 583/week @ 2024-09-08 486/week @ 2024-09-15 621/week @ 2024-09-22 690/week @ 2024-09-29 407/week @ 2024-10-06 517/week @ 2024-10-13 606/week @ 2024-10-20 568/week @ 2024-10-27 675/week @ 2024-11-03

2,375 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.5–2.1MB
~34K SLoC