Crates.io | keystore-rs |
lib.rs | keystore-rs |
version | 0.1.2 |
source | src |
created_at | 2024-07-17 10:38:35.376809 |
updated_at | 2024-10-09 13:59:28.619355 |
description | A Rust library for securely generating, storing, and managing cryptographic keys with support for macOS and Linux keychain integration. |
homepage | https://github.com/deltadevsde/keystore |
repository | https://github.com/deltadevsde/keystore |
max_upload_size | |
id | 1306086 |
size | 13,700 |
Keystore-rs is a Rust library for securely storing and managing cryptographic keys.
Add the following to your Cargo.toml
:
[dependencies]
keystore-rs = "0.1.0"
or
cargo add keystore-rs
Here is a basic example of how to use Keystore:
use keystore_rs::{create_signing_key, KeyStore, KeyStoreType, FileStore};
fn main() {
// Create a new signing key
let signing_key = create_signing_key();
// Create a file-based keystore
let file_store = FileStore::new("keyfile");
// Create a keystore enum
let keystore = KeyStoreType::FileStore(file_store);
// Add the signing key to the keystore
keystore.add_signing_key(&signing_key).unwrap();
// Retrieve the signing key from the keystore
let retrieved_key = keystore.get_signing_key().unwrap();
assert_eq!(signing_key.to_bytes(), retrieved_key.to_bytes());
}
Contributions are welcome! Please feel free to get in touch.
This project is licensed under the MIT License.