#key #key-store #keychain #integration #securely #storing #linux

keystore-rs

A Rust library for securely generating, storing, and managing cryptographic keys with support for macOS and Linux keychain integration

4 releases

new 0.3.0 Jan 16, 2025
0.1.2 Oct 9, 2024
0.1.1 Oct 9, 2024
0.1.0 Jul 17, 2024

#749 in Cryptography

Download history 109/week @ 2024-09-25 28/week @ 2024-10-02 341/week @ 2024-10-09 43/week @ 2024-10-16 10/week @ 2024-10-23 23/week @ 2024-10-30 19/week @ 2024-11-06 9/week @ 2024-11-13 126/week @ 2024-11-20 69/week @ 2024-11-27 113/week @ 2024-12-04 218/week @ 2024-12-11 115/week @ 2024-12-18 18/week @ 2024-12-25 47/week @ 2025-01-01 119/week @ 2025-01-08

345 downloads per month

MIT license

13KB
204 lines

keystore

Keystore-rs is a Rust library for securely storing and managing cryptographic keys.

Features

  • Secure key generation
  • Key storage and retrieval
  • Supports macOS and Linux keychain integration

Installation

Add the following to your Cargo.toml:

[dependencies]
keystore-rs = "0.1.0"

or

cargo add keystore-rs

Usage

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());
}

Contributing

Contributions are welcome! Please feel free to get in touch.

License

This project is licensed under the MIT License.

Dependencies

~4.5MB
~90K SLoC