26 releases

0.1.0 Nov 4, 2021
0.0.9 Nov 4, 2021
0.0.2 Jul 27, 2021
0.0.1-alpha.11 Mar 10, 2021
0.0.1-alpha.8 Nov 16, 2020

#105 in Cryptography

Download history 693/week @ 2021-10-07 961/week @ 2021-10-14 707/week @ 2021-10-21 919/week @ 2021-10-28 904/week @ 2021-11-04 696/week @ 2021-11-11 447/week @ 2021-11-18 557/week @ 2021-11-25 734/week @ 2021-12-02 616/week @ 2021-12-09 823/week @ 2021-12-16 241/week @ 2021-12-23 329/week @ 2021-12-30 641/week @ 2022-01-06 376/week @ 2022-01-13 445/week @ 2022-01-20

1,860 downloads per month
Used in 23 crates (3 directly)

Apache-2.0

245KB
5K SLoC

Crates.io Crates.io

lair_keystore_api

Secret lair private keystore API library.

This library crate contains most of the logic for dealing with lair.

  • If you wish to run an in-process / in-memory keystore, or connect to an external lair keystore as a client, this is the library for you.
  • If you want to run the canonical lair-keystore, you need the lair_keystore crate.
  • If you want to run a canonical lair-keystore in-process, but using the canonical sqlcipher database, you also the lair_keystore crate.
  • See the lair_api module for information about the lair_keystore_api protocol.
  • See LairClient for the client struct api.
Establishing a client connection to a canonical ipc keystore binary:
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).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());

Dependencies

~21MB
~443K SLoC