2026-01-19 20:54:39 +01:00
|
|
|
(* TODO functorize *)
|
2025-12-15 16:43:49 +01:00
|
|
|
open Crypto
|
|
|
|
|
|
2025-12-15 15:01:40 +01:00
|
|
|
type t
|
|
|
|
|
|
2025-12-16 14:20:41 +01:00
|
|
|
val sign_with_sm_key : t -> string -> eddsa_sig
|
|
|
|
|
val sign_with_signkey : t -> pub:eddsa_pub -> string -> eddsa_sig
|
|
|
|
|
val verify_with_master_key : eddsa_sig -> msg:string -> (unit, string) result
|
|
|
|
|
val verify_with_sm_key : t -> eddsa_sig -> msg:string -> (unit, string) result
|
|
|
|
|
|
|
|
|
|
val verify_with_signkey :
|
|
|
|
|
t -> pub:eddsa_pub -> eddsa_sig -> msg:string -> (unit, string) result
|
|
|
|
|
|
2025-12-16 18:02:13 +01:00
|
|
|
(* TODO query database instead? *)
|
2025-12-15 15:01:40 +01:00
|
|
|
val get_sm_key_pub : t -> eddsa_pub
|
2025-12-16 15:30:55 +01:00
|
|
|
val get_signkeys_data : t -> Signkey_data.t list
|
|
|
|
|
val get_denoms_data : t -> Denom_data.t list
|
2025-12-16 14:20:41 +01:00
|
|
|
val find_signkey_data : t -> eddsa_pub -> Signkey_data.t option
|
|
|
|
|
val find_denom_data : t -> denomination_hash -> Denom_data.t option
|
2025-12-16 17:21:50 +01:00
|
|
|
val find_denom_section_name : t -> denomination_hash -> string option
|
2025-12-15 15:01:40 +01:00
|
|
|
|
|
|
|
|
(* - management operations - *)
|
2025-12-21 20:06:01 +01:00
|
|
|
(* TODO
|
|
|
|
|
problem of keeping db and secmod state syncronized
|
|
|
|
|
do db interaction from secmod? *)
|
2025-12-16 14:20:41 +01:00
|
|
|
val init : (module Pg.CONN) -> t
|
2025-12-15 15:01:40 +01:00
|
|
|
|
|
|
|
|
val add_signkey_master_signatures :
|
|
|
|
|
(module Pg.CONN) ->
|
|
|
|
|
t ->
|
|
|
|
|
(eddsa_pub * Bin_sig.ExchangeSigningKeyValidity.t) list ->
|
|
|
|
|
(unit, string) result
|
|
|
|
|
|
|
|
|
|
val add_denom_master_signatures :
|
|
|
|
|
(module Pg.CONN) ->
|
|
|
|
|
t ->
|
2025-12-15 16:43:49 +01:00
|
|
|
(denomination_hash * Bin_sig.DenominationKeyValidity.t) list ->
|
2025-12-15 15:01:40 +01:00
|
|
|
(unit, string) result
|
|
|
|
|
|
|
|
|
|
val revoke_signkey :
|
|
|
|
|
t ->
|
|
|
|
|
eddsa_pub ->
|
|
|
|
|
Bin_sig.MasterSigningKeyRevocation.t ->
|
|
|
|
|
(unit, string) result
|
|
|
|
|
|
|
|
|
|
val revoke_denomination :
|
|
|
|
|
t ->
|
2025-12-15 16:43:49 +01:00
|
|
|
denomination_hash ->
|
2025-12-15 15:01:40 +01:00
|
|
|
Bin_sig.MasterDenominationKeyRevocation.t ->
|
|
|
|
|
(unit, string) result
|