220 releases

0.5.0-dev.20 Mar 3, 2025
0.5.0-dev.15 Jan 29, 2025
0.5.0-dev.11 Dec 25, 2024
0.5.0-dev.7 Nov 27, 2024
0.0.2 Jul 29, 2021

#791 in Magic Beans

Download history 734/week @ 2024-11-30 685/week @ 2024-12-07 646/week @ 2024-12-14 184/week @ 2024-12-21 88/week @ 2024-12-28 342/week @ 2025-01-04 462/week @ 2025-01-11 452/week @ 2025-01-18 486/week @ 2025-01-25 617/week @ 2025-02-01 546/week @ 2025-02-08 512/week @ 2025-02-15 421/week @ 2025-02-22 790/week @ 2025-03-01 476/week @ 2025-03-08 314/week @ 2025-03-15

2,050 downloads per month
Used in 33 crates (11 directly)

Apache-2.0

520KB
11K SLoC

holochain_keystore

A Keystore is a secure repository of private keys. MetaLairClient is a reference to a Keystore. MetaLairClient allows async generation of keypairs, and usage of those keypairs, reference by the public AgentPubKey.

Examples

use holo_hash::AgentPubKey;
use holochain_keystore::*;
use holochain_serialized_bytes::prelude::*;

#[tokio::main(flavor = "multi_thread")]
async fn main() {
    tokio::task::spawn(async move {
        let keystore = holochain_keystore::spawn_test_keystore().await.unwrap();
        let agent_pubkey = AgentPubKey::new_random(&keystore).await.unwrap();

        #[derive(Debug, serde::Serialize, serde::Deserialize, SerializedBytes)]
        struct MyData(Vec<u8>);

        let my_data_1 = MyData(b"signature test data 1".to_vec());

        let signature = agent_pubkey.sign(&keystore, &my_data_1).await.unwrap();

        assert!(agent_pubkey.verify_signature(&signature, &my_data_1).await.unwrap());
    }).await.unwrap();
}

License: CAL-1.0

Dependencies

~73MB
~1.5M SLoC