untested: rsa pub binary format
This commit is contained in:
parent
9ee9c787fd
commit
be2e590e93
4 changed files with 178 additions and 103 deletions
18
src/json.ml
18
src/json.ml
|
|
@ -76,15 +76,17 @@ end
|
|||
let amount_jsont =
|
||||
Jsont.of_of_string ~kind:"Amount" Amount.of_string ~enc:Amount.to_string
|
||||
|
||||
module Eddsa = struct
|
||||
open Eddsa
|
||||
module EddsaPublicKey = struct
|
||||
open EddsaPublicKey
|
||||
|
||||
let pub_jsont =
|
||||
let dec = Jsont.Base.dec_result pub_of_string in
|
||||
let enc = Jsont.Base.enc pub_to_string in
|
||||
let jsont =
|
||||
let dec = Jsont.Base.dec_result of_string in
|
||||
let enc = Jsont.Base.enc to_string in
|
||||
Jsont.Base.string (Jsont.Base.map ~kind:"EddsaPublicKey" ~dec ~enc ())
|
||||
end
|
||||
|
||||
let signature_jsont = Jsont.string
|
||||
module EddsaSignature = struct
|
||||
let jsont = Jsont.string
|
||||
end
|
||||
|
||||
module RsaDenominationKey = struct
|
||||
|
|
@ -148,10 +150,10 @@ module FutureSignKey = struct
|
|||
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 "key" EddsaPublicKey.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
|
||||
|> mem "signkey_secmod_sig" EddsaSignature.jsont ~enc:signkey_secmod_sig
|
||||
|> finish
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue