Key generation, saving and loading works.

This commit is contained in:
Dave Hrycyszyn
2024-06-06 18:52:39 +01:00
parent 6d6c544dd5
commit cda6dd2901
9 changed files with 67 additions and 58 deletions

15
side-node/src/utils.rs Normal file
View File

@@ -0,0 +1,15 @@
use std::path::PathBuf;
pub(crate) const KEY_FILE: &str = "keys.pem";
pub(crate) const CONFIG_FILE: &str = "config.toml";
/// Returns the path to the key file for this host OS.
pub(crate) fn side_paths(prefix: PathBuf) -> (PathBuf, PathBuf) {
let mut key_path = prefix.clone();
key_path.push(KEY_FILE);
let mut config_path = prefix.clone();
config_path.push(CONFIG_FILE);
(key_path, config_path)
}