Keyring-search v0.2.0
Usage
To use this library in your project add the following to your Cargo.toml file:
[]
= "0.2.0"
This is a cross-platform library for searching the platform specific keystore.
Currently supported platforms are Linux, Windows, macOS, and iOS.
Design
This crate, originally planned as a feature for keyring provides a broad search of the platform specific keystores based on user provided search parameters.
Windows
Windows machines have the option to search by 'user', 'service', or 'target'.
use ;
let result = new
.expect
.by;
let list = list_credentials
.expect;
println!;
Linux - Secret Service
If using the Linux Secret Service platform, the keystore is stored as a HashMap, and thus is more liberal with the keys that can be searched. The by method will take any parameter passed and attempt to search for the user defined key.
use ;
let result = new
.expect
.by;
let list = list_credentials
.expect;
println!;
Linux - Keyutils
If using the Linux Keyutils platform, the keystore is non persistent and is used more as a secure cache. However, this can still be searched. The breadth of the by method is large and encompasses the different types of keyrings available: "thread", "process", "session, "user", "user session", and "group". Because of this searching mechanism, the search has to be rather specific while limiting the different types of data to search, i.e. user, account, service.
use ;
let result = new
.expect
.by;
let list = list_credentials
.expect;
println!;
MacOS
MacOS machines have the option to search by 'account', 'service', or 'label.
use ;
let result = new
.expect
.by;
let list = list_credentials
.expect;
println!;
Errors
Search Error is the only error type currently.
Examples
Examples coming soon.
Client Testing
Basic tests for the search platform.
Platforms
MacOS, Windows, iOS, Linux-Keyutils/Secret Service
License
Licensed under either
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.