1pub mod file;
2pub mod os;
3
4use anyhow::Result;
5use ed25519_consensus::SigningKey;
6use mockall::automock;
7use rand::rngs::OsRng;
8
9pub use file::FileStore;
10pub use os::KeyChain;
11
12pub fn create_signing_key() -> SigningKey {
13 SigningKey::new(OsRng)
14}
15
16#[automock]
17pub trait KeyStore {
18 fn add_signing_key(&self, id: &str, signing_key: &SigningKey) -> Result<()>;
19 fn get_signing_key(&self, id: &str) -> Result<SigningKey>;
20 fn get_or_create_signing_key(&self, id: &str) -> Result<SigningKey>;
21}