add secmod_denom.ml secmod_signkey.ml
This commit is contained in:
parent
16ab1fff2b
commit
846122b49c
5 changed files with 121 additions and 135 deletions
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue