diff --git a/src/api.ml b/src/api.ml index 96118999..f2fbf58e 100644 --- a/src/api.ml +++ b/src/api.ml @@ -316,3 +316,27 @@ module MasterSignatures = struct |> mem "signkey_sigs" (Jsont.list SignKeySignature.jsont) ~enc:signkey_sigs |> finish end + +module DenomRevocationSignature = struct + type t = { master_sig: MasterDenominationKeyRevocationPS.t } + + let jsont = + let make master_sig = { master_sig } in + let enc v = v.master_sig in + let open Jsont.Object in + map ~kind:"DenomRevocationSignature" make + |> mem "master_sig" MasterDenominationKeyRevocationPS.jsont ~enc + |> finish +end + +module SignkeyRevocationSignature = struct + type t = { master_sig: MasterSigningKeyRevocationPS.t } + + let jsont = + let make master_sig = { master_sig } in + let enc v = v.master_sig in + let open Jsont.Object in + map ~kind:"SignkeyRevocationSignature" make + |> mem "master_sig" MasterSigningKeyRevocationPS.jsont ~enc + |> finish +end diff --git a/src/bin_signature.ml b/src/bin_signature.ml index e6b3690a..76b6bc2b 100644 --- a/src/bin_signature.ml +++ b/src/bin_signature.ml @@ -207,6 +207,44 @@ module ExchangeSigningKeyValidityPS = struct include MK (R) end +module MasterDenominationKeyRevocationPS = struct + module R = struct + (* purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. *) + type r = { h_denom_pub: DenominationHash.t } + + let bin = + let open Bin in + Purpose.make_bin Taler_signatures.master_denomination_key_revoked + @@ fun purpose -> + record (fun _purpose h_denom_pub -> { h_denom_pub }) + |+ Purpose.field purpose + |+ field DenominationHash.bin (fun t -> t.h_denom_pub) + |> sealr + end + + include R + include MK (R) +end + +module MasterSigningKeyRevocationPS = struct + module R = struct + (* purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED *) + type r = { exchange_pub: ExchangePublicKeyP.t } + + let bin = + let open Bin in + Purpose.make_bin Taler_signatures.master_signing_key_revoked + @@ fun purpose -> + record (fun _purpose exchange_pub -> { exchange_pub }) + |+ Purpose.field purpose + |+ field ExchangePublicKeyP.bin (fun t -> t.exchange_pub) + |> sealr + end + + include R + include MK (R) +end + (* ### BIN IMPL END ### *) module WithdrawRequestPS = struct @@ -711,16 +749,6 @@ module CoinPurseRefundConfirmationPS = struct } end -module MasterDenominationKeyRevocationPS = struct - (* purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED *) - type t = { h_denom_pub: DenominationHash.t } -end - -module MasterSigningKeyRevocationPS = struct - (* purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED *) - type t = { exchange_pub: ExchangePublicKeyP.t } -end - module MasterAddAuditorPS = struct (* purpose.purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR *) type t = {