209 releases

new 0.5.0-dev.14 Jan 22, 2025
0.5.0-dev.11 Dec 25, 2024
0.5.0-dev.7 Nov 27, 2024
0.4.1-rc.1 Jan 17, 2025
0.0.2 Jul 29, 2021

#718 in Magic Beans

Download history 724/week @ 2024-10-01 495/week @ 2024-10-08 880/week @ 2024-10-15 431/week @ 2024-10-22 581/week @ 2024-10-29 493/week @ 2024-11-05 544/week @ 2024-11-12 508/week @ 2024-11-19 1047/week @ 2024-11-26 497/week @ 2024-12-03 708/week @ 2024-12-10 584/week @ 2024-12-17 156/week @ 2024-12-24 89/week @ 2024-12-31 437/week @ 2025-01-07 444/week @ 2025-01-14

1,134 downloads per month
Used in 30 crates (10 directly)

Apache-2.0

540KB
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

~72MB
~1.5M SLoC