This commit is contained in:
parent
c991f29b28
commit
ad81e1892f
1 changed files with 25 additions and 0 deletions
25
src/json.ml
25
src/json.ml
|
|
@ -83,6 +83,8 @@ module Eddsa = struct
|
|||
let dec = Jsont.Base.dec_result pub_of_string in
|
||||
let enc = Jsont.Base.enc pub_to_string in
|
||||
Jsont.Base.string (Jsont.Base.map ~kind:"EddsaPublicKey" ~dec ~enc ())
|
||||
|
||||
let signature_jsont = Jsont.string
|
||||
end
|
||||
|
||||
module Rsa_denomination_key = struct
|
||||
|
|
@ -130,3 +132,26 @@ module Denomination_key = struct
|
|||
|> case_mem "cipher" Jsont.string ~enc:Fun.id ~enc_case cases
|
||||
|> finish
|
||||
end
|
||||
|
||||
module Future_sign_key = struct
|
||||
open Future_sign_key
|
||||
|
||||
let jsont =
|
||||
(* TODO ppx? *)
|
||||
let make key stamp_start stamp_expire stamp_end signkey_secmod_sig =
|
||||
{ key; stamp_start; stamp_expire; stamp_end; signkey_secmod_sig }
|
||||
in
|
||||
let key v = v.key in
|
||||
let stamp_start v = v.stamp_start in
|
||||
let stamp_expire v = v.stamp_expire in
|
||||
let stamp_end v = v.stamp_end in
|
||||
let signkey_secmod_sig v = v.signkey_secmod_sig in
|
||||
let open Jsont.Object in
|
||||
map ~kind:"FutureSignKey" make
|
||||
|> mem "key" Eddsa.pub_jsont ~enc:key
|
||||
|> mem "stamp_start" Timestamp.jsont ~enc:stamp_start
|
||||
|> mem "stamp_expire" Timestamp.jsont ~enc:stamp_expire
|
||||
|> mem "stamp_end" Timestamp.jsont ~enc:stamp_end
|
||||
|> mem "signkey_secmod_sig" Eddsa.signature_jsont ~enc:signkey_secmod_sig
|
||||
|> finish
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue