149 releases

new 0.3.0-beta-dev.37 Apr 25, 2024
0.3.0-beta-dev.32 Mar 27, 2024
0.3.0-beta-dev.21 Dec 22, 2023
0.3.0-beta-dev.18 Nov 22, 2023
0.0.2 Jul 29, 2021

#51 in Magic Beans

Download history 40/week @ 2024-01-02 249/week @ 2024-01-09 173/week @ 2024-01-16 224/week @ 2024-01-23 269/week @ 2024-01-30 430/week @ 2024-02-06 176/week @ 2024-02-13 248/week @ 2024-02-20 661/week @ 2024-02-27 627/week @ 2024-03-05 519/week @ 2024-03-12 616/week @ 2024-03-19 309/week @ 2024-03-26 649/week @ 2024-04-02 705/week @ 2024-04-09 603/week @ 2024-04-16

2,297 downloads per month
Used in 26 crates (9 directly)

Apache-2.0 and AGPL-3.0 WITH mif-exception

615KB
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 = 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

~57–95MB
~1.5M SLoC