Is there a way to use a Rust based alternative to libsecret on linux? I want to replace…
- User
Is there a way to use a Rust based alternative to libsecret on linux? I want to replace the function of gnome keyring
Assistant
Yes, there are several Rust-based alternatives you can use to replace GNOME Keyring's functionality on Linux:
secret-service-rs is probably your best starting point. It's a Rust implementation of the Secret Service API that GNOME Keyring uses, so it can serve as a drop-in replacement while maintaining compatibility with existing applications that expect the Secret Service D-Bus interface.
keepass-rs provides Rust bindings for KeePass databases. If you're open to using KeePass as your backend storage format, this gives you a robust, cross-platform solution with good Rust integration.
keyring-rs is a cross-platform Rust library that abstracts over different credential storage backends. On Linux, it can use the Secret Service API, but it also supports other backends, giving you flexibility.
For a more minimal approach, you could build something custom using zbus (Rust D-Bus library) to implement just the Secret Service API endpoints you need, backed by encrypted storage of your choice.
If you want to completely move away from the Secret Service API standard, or (Rust implementation of age) provide excellent file-based encryption that you could use to build a simple credential manager.
- User
It has to be able to be used to automatically unlock wifi networks
Assistant
For automatically unlocking WiFi networks, you'll need something that implements the Secret Service D-Bus API, since NetworkManager specifically looks for credentials through that interface.
secret-service-rs is really your only viable option here. It's a Rust implementation that provides the same D-Bus interface that GNOME Keyring does, so NetworkManager will be able to find and use stored WiFi passwords without any configuration changes.
The other alternatives I mentioned won't work for this use case because:
- keepass-rs, keyring-rs, and custom solutions don't expose the Secret Service D-Bus interface
- NetworkManager is hardcoded to look for WiFi credentials via the Secret Service API
- File-based solutions like age/rage would require you to manually integrate them with NetworkManager
With secret-service-rs, you'd run it as a daemon that:
- Implements the
org.freedesktop.secretsD-Bus interface - Stores encrypted credentials (WiFi passwords, etc.)
- Responds to NetworkManager's requests for WiFi passwords