194 releases

new 0.5.0-dev.6 Nov 20, 2024
0.5.0-dev.3 Oct 30, 2024
0.4.0-dev.14 Jul 24, 2024
0.3.0-beta-dev.32 Mar 27, 2024
0.0.2 Jul 29, 2021

#128 in Magic Beans

Download history 826/week @ 2024-07-31 570/week @ 2024-08-07 581/week @ 2024-08-14 428/week @ 2024-08-21 482/week @ 2024-08-28 517/week @ 2024-09-04 923/week @ 2024-09-11 962/week @ 2024-09-18 970/week @ 2024-09-25 663/week @ 2024-10-02 708/week @ 2024-10-09 675/week @ 2024-10-16 415/week @ 2024-10-23 604/week @ 2024-10-30 476/week @ 2024-11-06 471/week @ 2024-11-13

2,005 downloads per month
Used in 28 crates (10 directly)

Apache-2.0 and AGPL-3.0 WITH mif-exception

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

~57–94MB
~1.5M SLoC