use Jsont.Error for unsupported CS denom + wip type binary signature

This commit is contained in:
swrup 2025-11-30 22:44:36 +01:00
parent 4568b1bd4c
commit eb56150120
6 changed files with 66 additions and 45 deletions

View file

@ -88,7 +88,7 @@ module DenominationKeyAnnouncementPS = struct
(* TODO taler_signatures purpose
we use TALER_SIGNATURE_SM_RSA_DENOMINATION_KEY instead here *)
(* purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY *)
type t = {
type r = {
h_denom_pub: DenominationHash.t;
h_section_name: Hash_64_cstr.t;
anchor_time: TimeAbsoluteNBO.t;
@ -107,6 +107,24 @@ module DenominationKeyAnnouncementPS = struct
|+ field TimeAbsoluteNBO.bin (fun t -> t.anchor_time)
|+ field TimeRelativeNBO.bin (fun t -> t.duration_withdraw)
|> sealr
module type SIG = sig
type t
val sign : (string -> string) -> r -> t
val verify : (string -> msg:string -> bool) -> t -> r -> bool
val jsont : t Jsont.t
end
module Sig : SIG = struct
type t = string
let sign f r = f @@ Bin.to_string bin r
let verify f s r = f s ~msg:(Bin.to_string bin r)
(* TODO B32.jsont, for others types too *)
let jsont = Jsont.string
end
end
module SigningKeyAnnouncementPS = struct