47 releases

0.5.2 Sep 20, 2024
0.5.0 Aug 22, 2024
0.4.5 Jun 6, 2024
0.4.4 Mar 1, 2024
0.0.1-alpha.8 Nov 16, 2020

#98 in Cryptography

Download history 819/week @ 2024-07-05 911/week @ 2024-07-12 918/week @ 2024-07-19 1329/week @ 2024-07-26 1011/week @ 2024-08-02 746/week @ 2024-08-09 775/week @ 2024-08-16 913/week @ 2024-08-23 861/week @ 2024-08-30 887/week @ 2024-09-06 1232/week @ 2024-09-13 1703/week @ 2024-09-20 743/week @ 2024-09-27 806/week @ 2024-10-04 950/week @ 2024-10-11 529/week @ 2024-10-18

3,397 downloads per month
Used in 42 crates (7 directly)

MIT/Apache

310KB
6.5K SLoC

lair_keystore_api

Secret lair private keystore API library.

Project Forum Chat

License: MIT License: Apache-2.0

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, see the lair_keystore crate.
  • If you want to run a canonical lair-keystore in-process, using the canonical sqlcipher database, see 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,
    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

Dependencies

~17–27MB
~486K SLoC