13 releases

new 0.0.13 Oct 27, 2021
0.0.12 Oct 21, 2021
0.0.8 Sep 29, 2021
0.0.4 Aug 25, 2021
0.0.1 Jun 30, 2021

#553 in Magic Beans

Download history 7/week @ 2021-07-06 4/week @ 2021-07-13 19/week @ 2021-07-20 21/week @ 2021-07-27 20/week @ 2021-08-03 8/week @ 2021-08-10 28/week @ 2021-08-17 113/week @ 2021-08-24 41/week @ 2021-08-31 30/week @ 2021-09-07 142/week @ 2021-09-14 268/week @ 2021-09-21 160/week @ 2021-09-28 165/week @ 2021-10-05 66/week @ 2021-10-12 58/week @ 2021-10-19

384 downloads per month
Used in 13 crates (5 directly)

Custom license and GPL-3.0-only

680KB
15K SLoC

crate

Project Forum Chat

Twitter Follow License: License: CAL 1.0

Current version: 0.0.1

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.

Example

use holo_hash::AgentPubKey;
use crate::*;
use holochain_serialized_bytes::prelude::*;

#[tokio::main(flavor = "multi_thread")]
async fn main() {
    tokio::task::spawn(async move {
        let _ = holochain_crypto::crypto_init_sodium();

        let keystore = test_keystore::spawn_test_keystore(vec![]).await.unwrap();
        let agent_pubkey = AgentPubKey::new_from_pure_entropy(&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();
}

Contribute

Holochain is an open source project. We welcome all sorts of participation and are actively working on increasing surface area to accept it. Please see our contributing guidelines for our general practices and protocols on participating in the community, as well as specific expectations around things like code formatting, testing practices, continuous integration, etc.

  • Connect with us on our forum

License

License: CAL 1.0

Copyright (C) 2019 - 2021, Holochain Foundation

This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (CAL-1.0). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Dependencies

~58MB
~1M SLoC

L6ya