Crates.io | lair_keystore_api |
lib.rs | lair_keystore_api |
version | 0.5.3 |
source | src |
created_at | 2020-09-01 19:25:23.910677 |
updated_at | 2024-11-27 16:40:01.806257 |
description | secret lair private keystore API library |
homepage | |
repository | https://github.com/holochain/lair |
max_upload_size | |
id | 283552 |
size | 317,986 |
Secret lair private keystore API library.
This library crate contains most of the logic for dealing with lair.
use lair_keystore_api::prelude::*;
use lair_keystore_api::ipc_keystore::*;
// create a client connection
let client =
ipc_keystore_connect(connection_url, passphrase)
.await
.unwrap();
// create a new seed
let seed_info = client.new_seed(
"test-seed".into(),
None,
false,
).await.unwrap();
// sign some data
let sig = client.sign_by_pub_key(
seed_info.ed25519_pub_key.clone(),
None,
b"test-data".to_vec().into(),
).await.unwrap();
// verify the signature
assert!(seed_info.ed25519_pub_key.verify_detached(
sig,
b"test-data".to_vec(),
).await.unwrap());
License: MIT OR Apache-2.0