49 releases

Uses new Rust 2021

0.0.49 Aug 3, 2022
0.0.48 Jul 28, 2022
0.0.44 Jun 29, 2022
0.0.32 Mar 30, 2022
0.0.2 Jul 29, 2021

#1391 in Magic Beans

Download history 307/week @ 2022-04-20 491/week @ 2022-04-27 546/week @ 2022-05-04 797/week @ 2022-05-11 430/week @ 2022-05-18 369/week @ 2022-05-25 416/week @ 2022-06-01 262/week @ 2022-06-08 317/week @ 2022-06-15 233/week @ 2022-06-22 149/week @ 2022-06-29 155/week @ 2022-07-06 342/week @ 2022-07-13 237/week @ 2022-07-20 236/week @ 2022-07-27 329/week @ 2022-08-03

1,161 downloads per month
Used in 14 crates (6 directly)

CAL-1.0 license

645KB
15K 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 = test_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

~67MB
~1.5M SLoC