203 releases

new 0.5.0-dev.10 Dec 18, 2024
0.5.0-dev.7 Nov 27, 2024
0.4.0 Dec 17, 2024
0.4.0-dev.14 Jul 24, 2024
0.0.2 Jul 29, 2021

#167 in Magic Beans

Download history 458/week @ 2024-08-26 485/week @ 2024-09-02 607/week @ 2024-09-09 1071/week @ 2024-09-16 1156/week @ 2024-09-23 703/week @ 2024-09-30 499/week @ 2024-10-07 922/week @ 2024-10-14 397/week @ 2024-10-21 509/week @ 2024-10-28 589/week @ 2024-11-04 417/week @ 2024-11-11 599/week @ 2024-11-18 934/week @ 2024-11-25 667/week @ 2024-12-02 687/week @ 2024-12-09

2,896 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

~72MB
~1.5M SLoC