89 releases

new 0.3.0-beta-dev.1 May 31, 2023
0.2.1-beta-dev.0 May 15, 2023
0.2.0-beta-rc.1 Mar 22, 2023
0.1.0-beta-rc.1 Dec 23, 2022
0.0.2 Jul 29, 2021

#973 in Magic Beans

Download history 459/week @ 2023-02-11 453/week @ 2023-02-18 1051/week @ 2023-02-25 244/week @ 2023-03-04 277/week @ 2023-03-11 440/week @ 2023-03-18 196/week @ 2023-03-25 249/week @ 2023-04-01 279/week @ 2023-04-08 434/week @ 2023-04-15 393/week @ 2023-04-22 425/week @ 2023-04-29 556/week @ 2023-05-06 433/week @ 2023-05-13 291/week @ 2023-05-20 508/week @ 2023-05-27

1,857 downloads per month
Used in 17 crates (7 directly)

CAL-1.0 license

560KB
13K 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);
    }).await.unwrap();
}

License: CAL-1.0

Dependencies

~52–88MB
~1.5M SLoC