Hansie Odendaal c80c3fd2e3
chore: config and naming updates (#27)
* Update config and crate naming

- Updated configs to the lates main repo configs.
- Updated all main repo crate namings to be same as the main repo.
- Added `create_dir_all` to `pub(crate) fn create_tempdir(custom_work_dir: Option<PathBuf>) -> std::io::Result<TempDir> {`.
- Wired in optional `persist_dir` when using the local deployer.
- Update `time` vulnerability

**Note:** Unsure about the `service_params` mapping in `pub(crate) fn cryptarchia_deployment(config: &GeneralConfig) -> CryptarchiaDeploymentSettings {`
2026-02-09 10:28:15 +02:00

15 lines
468 B
Rust

use lb_groth16::fr_to_bytes;
use lb_key_management_system_service::{
backend::preload::KeyId,
keys::{Key, secured_key::SecuredKey as _},
};
#[must_use]
pub fn key_id_for_preload_backend(key: &Key) -> KeyId {
let key_id_bytes = match key {
Key::Ed25519(ed25519_secret_key) => ed25519_secret_key.as_public_key().to_bytes(),
Key::Zk(zk_secret_key) => fr_to_bytes(zk_secret_key.as_public_key().as_fr()),
};
hex::encode(key_id_bytes)
}