add secmod_denom.ml secmod_signkey.ml

This commit is contained in:
swrup 2025-12-06 23:15:07 +01:00
parent 16ab1fff2b
commit 846122b49c
5 changed files with 121 additions and 135 deletions

View file

@ -12,18 +12,13 @@ type t = {
master_sig: EddsaSignature.t option;
}
let generate () =
(* TODO
- look if it exists
- if not, create it (TOFU initialization scheme)
- write it *)
let make () =
let stamp_start = Ptime_clock.now () |> Option.some in
let stamp_expire =
Timestamp.add_span_exn stamp_start
(Some Config.Exchange.signkey_legal_duration)
in
let stamp_end = stamp_expire in
let priv, pub = Mirage_crypto_ec.Ed25519.generate () in
let master_sig = None in
{ pub; priv; stamp_start; stamp_expire; stamp_end; master_sig }